ultimatepp/uppsrc/Web/SSL/httpscli.cpp
rylek e19e934dae *Web: bug fix - default HTTPS port number
*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
2011-06-23 00:32:01 +00:00

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