From ea700d80f5d65f7d6c4cab4ccd09192467b15204 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Mon, 13 May 2013 16:05:56 +0200 Subject: Cross-platform and (truly) thread-safe OpenSSL initialization. --- src/net/tls/openssl/TLSSession_OpenSSL.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/net/tls/openssl/TLSSession_OpenSSL.cpp') diff --git a/src/net/tls/openssl/TLSSession_OpenSSL.cpp b/src/net/tls/openssl/TLSSession_OpenSSL.cpp index a18e2958..fcf82c7b 100644 --- a/src/net/tls/openssl/TLSSession_OpenSSL.cpp +++ b/src/net/tls/openssl/TLSSession_OpenSSL.cpp @@ -41,6 +41,9 @@ namespace net { namespace tls { +static OpenSSLInitializer::autoInitializer openSSLInitializer; + + // static ref TLSSession::create(ref cv) { @@ -51,9 +54,6 @@ ref TLSSession::create(ref cv TLSSession_OpenSSL::TLSSession_OpenSSL(ref cv) : m_sslctx(0), m_certVerifier(cv) { - // Thread-safe OpenSSL initialization - static OpenSSLInitializer openSSLInitialization; - m_sslctx = SSL_CTX_new(SSLv23_client_method()); SSL_CTX_set_options(m_sslctx, SSL_OP_ALL | SSL_OP_NO_SSLv2); SSL_CTX_set_mode(m_sslctx, SSL_MODE_AUTO_RETRY); -- cgit v1.2.3