diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc index 078b11f1..caa8413a 100644 --- a/src/HttpRequestCommand.cc +++ b/src/HttpRequestCommand.cc @@ -36,12 +36,9 @@ HttpRequestCommand::~HttpRequestCommand() {} bool HttpRequestCommand::executeInternal(Segment seg) { socket->setNonBlockingMode(); -#ifdef HAVE_LIBSSL - // for SSL if(req->getProtocol() == "https") { socket->initiateSecureConnection(); } -#endif // HAVE_LIBSSL HttpConnection httpConnection(cuid, socket, e->option, e->logger); // set seg to request in order to remember the request range req->seg = seg; diff --git a/src/Socket.cc b/src/Socket.cc index 9a53cd67..bf9a04f1 100644 --- a/src/Socket.cc +++ b/src/Socket.cc @@ -81,9 +81,6 @@ void Socket::peekData(char* data, int& len, int timeout) { core->peekData(data, len, timeout); } -#ifdef HAVE_LIBSSL -// for SSL void Socket::initiateSecureConnection() { core->initiateSecureConnection(); } -#endif // HAVE_LIBSSL diff --git a/src/Socket.h b/src/Socket.h index 45f2d298..a4624801 100644 --- a/src/Socket.h +++ b/src/Socket.h @@ -76,10 +76,11 @@ public: // this socket. void peekData(char* data, int& len, int timeout = 5); -#ifdef HAVE_LIBSSL - // for SSL + /** + * Makes this socket secure. + * If the system has not OpenSSL, then this method do nothing. + */ void initiateSecureConnection(); -#endif // HAVE_LIBSSL }; #endif // _D_SOCKET_H_ diff --git a/src/SocketCore.cc b/src/SocketCore.cc index 07b4b3c1..94b986ed 100644 --- a/src/SocketCore.cc +++ b/src/SocketCore.cc @@ -193,9 +193,9 @@ void SocketCore::peekData(char* data, int& len, int timeout) { } } -#ifdef HAVE_LIBSSL -// for SSL void SocketCore::initiateSecureConnection() { +#ifdef HAVE_LIBSSL + // for SSL if(!secure) { sslCtx = SSL_CTX_new(SSLv23_client_method()); if(sslCtx == NULL) { @@ -215,5 +215,6 @@ void SocketCore::initiateSecureConnection() { } secure = true; } -} #endif // HAVE_LIBSSL +} + diff --git a/src/SocketCore.h b/src/SocketCore.h index f7a75b43..ba5fb7af 100644 --- a/src/SocketCore.h +++ b/src/SocketCore.h @@ -84,12 +84,11 @@ public: // this socket. void peekData(char* data, int& len, int timeout = 5); -#ifdef HAVE_LIBSSL /** - * Makes this socket SSL endpoint + * Makes this socket secure. + * If the system has not OpenSSL, then this method do nothing. */ void initiateSecureConnection(); -#endif // HAVE_LIB_SSL }; #endif // _D_SOCKET_CORE_H_