mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 22:02:49 -06:00
*Web: added ugly hack to get rid of SSL memory leaks git-svn-id: svn://ultimatepp.org/upp/trunk@3553 f0d560ea-af0d-0410-9eb7-867de7ffcac7
34 lines
679 B
C++
34 lines
679 B
C++
#ifndef flagNOSSL
|
|
|
|
#include "WebSSL.h"
|
|
|
|
NAMESPACE_UPP
|
|
|
|
HttpsClient::HttpsClient()
|
|
{
|
|
secure = true;
|
|
}
|
|
|
|
bool HttpsClient::CreateClientSocket()
|
|
{
|
|
if(!secure)
|
|
return HttpClient::CreateClientSocket();
|
|
if(!ssl_context) {
|
|
ssl_context = new SSLContext;
|
|
if(!ssl_context->Create(const_cast<SSL_METHOD *>(SSLv3_client_method()))) {
|
|
error = t_("Error creating SSL context.");
|
|
return false;
|
|
}
|
|
}
|
|
if(!SSLClientSocket(socket, *ssl_context, socket_host,
|
|
socket_port ? socket_port : DEFAULT_HTTPS_PORT, true, NULL, 0, false)) {
|
|
error = Socket::GetErrorText();
|
|
return false;
|
|
}
|
|
socket.Linger(0);
|
|
return true;
|
|
}
|
|
|
|
END_UPP_NAMESPACE
|
|
|
|
#endif
|