MCPcopy Create free account
hub / github.com/apache/thrift / initializeOpenSSL

Function initializeOpenSSL

lib/cpp/src/thrift/transport/TSSLSocket.cpp:115–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void initializeOpenSSL() {
116 if (openSSLInitialized) {
117 return;
118 }
119 openSSLInitialized = true;
120 SSL_library_init();
121 SSL_load_error_strings();
122 ERR_load_crypto_strings();
123
124 // static locking
125 // newer versions of OpenSSL changed CRYPTO_num_locks - see THRIFT-3878
126#ifdef CRYPTO_num_locks
127 mutexes = boost::shared_array<Mutex>(new Mutex[CRYPTO_num_locks()]);
128#else
129 mutexes = boost::shared_array<Mutex>(new Mutex[ ::CRYPTO_num_locks()]);
130#endif
131
132#if (OPENSSL_VERSION_NUMBER < OPENSSL_VERSION_NO_THREAD_ID_BEFORE)
133 CRYPTO_set_id_callback(callbackThreadID);
134#endif
135
136 CRYPTO_set_locking_callback(callbackLocking);
137
138 // dynamic locking
139 CRYPTO_set_dynlock_create_callback(dyn_create);
140 CRYPTO_set_dynlock_lock_callback(dyn_lock);
141 CRYPTO_set_dynlock_destroy_callback(dyn_destroy);
142}
143
144void cleanupOpenSSL() {
145 if (!openSSLInitialized) {

Callers 6

GlobalFixtureMethod · 0.85
GlobalFixtureMethod · 0.85
GlobalFixtureSSLMethod · 0.85
openssl_initFunction · 0.85
GlobalFixtureSSLMethod · 0.85
TSSLSocketFactoryMethod · 0.85

Calls

no outgoing calls

Tested by 5

GlobalFixtureMethod · 0.68
GlobalFixtureMethod · 0.68
GlobalFixtureSSLMethod · 0.68
openssl_initFunction · 0.68
GlobalFixtureSSLMethod · 0.68