aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/tls/openssl/TLSSession_OpenSSL.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2012-11-06 15:05:04 +0000
committerVincent Richard <[email protected]>2012-11-06 15:05:04 +0000
commita6a098b473de2a37526fe036e88301e5ac9265dc (patch)
tree9cac2808d955e0149fbf1d022733abaa12e38ca7 /src/net/tls/openssl/TLSSession_OpenSSL.cpp
parentAdded missing file. (diff)
downloadvmime-a6a098b473de2a37526fe036e88301e5ac9265dc.tar.gz
vmime-a6a098b473de2a37526fe036e88301e5ac9265dc.zip
Thread-safe initialization for OpenSSL.
Diffstat (limited to 'src/net/tls/openssl/TLSSession_OpenSSL.cpp')
-rwxr-xr-xsrc/net/tls/openssl/TLSSession_OpenSSL.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/net/tls/openssl/TLSSession_OpenSSL.cpp b/src/net/tls/openssl/TLSSession_OpenSSL.cpp
index e03c90f6..5d7e1052 100755
--- a/src/net/tls/openssl/TLSSession_OpenSSL.cpp
+++ b/src/net/tls/openssl/TLSSession_OpenSSL.cpp
@@ -47,10 +47,6 @@ namespace net {
namespace tls {
-// Thread-safe OpenSSL initialization
-static OpenSSLInitializer g_openSSLGlobal;
-
-
// static
ref <TLSSession> TLSSession::create(ref <security::cert::certificateVerifier> cv)
{
@@ -61,6 +57,9 @@ ref <TLSSession> TLSSession::create(ref <security::cert::certificateVerifier> cv
TLSSession_OpenSSL::TLSSession_OpenSSL(ref <vmime::security::cert::certificateVerifier> 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);
}