3131#include < mutex>
3232#include < condition_variable>
3333#include < openssl/ssl.h>
34- #if OPENSSL_VERSION_NUMBER < 0x10100000L
35- # include < openssl/err.h>
36- # include < openssl/engine.h>
37- # include < openssl/conf.h>
38- # include < openssl/crypto.h>
39- #endif
4034#include " CommScheduler.h"
4135#include " Executor.h"
4236#include " WFResourcePool.h"
@@ -179,18 +173,6 @@ __WFGlobal::__WFGlobal()
179173 sync_max_ = 0 ;
180174}
181175
182- #if OPENSSL_VERSION_NUMBER < 0x10100000L
183- static std::mutex *__ssl_mutex;
184-
185- static void ssl_locking_callback (int mode, int type, const char * file, int line)
186- {
187- if (mode & CRYPTO_LOCK)
188- __ssl_mutex[type].lock ();
189- else if (mode & CRYPTO_UNLOCK)
190- __ssl_mutex[type].unlock ();
191- }
192- #endif
193-
194176class __SSLManager
195177{
196178public:
@@ -206,15 +188,6 @@ class __SSLManager
206188private:
207189 __SSLManager ()
208190 {
209- #if OPENSSL_VERSION_NUMBER < 0x10100000L
210- __ssl_mutex = new std::mutex[CRYPTO_num_locks ()];
211- CRYPTO_set_locking_callback (ssl_locking_callback);
212- SSL_library_init ();
213- SSL_load_error_strings ();
214- // ERR_load_crypto_strings();
215- // OpenSSL_add_all_algorithms();
216- #endif
217-
218191 ssl_client_ctx_ = SSL_CTX_new (SSLv23_client_method ());
219192 if (ssl_client_ctx_ == NULL )
220193 abort ();
@@ -223,29 +196,6 @@ class __SSLManager
223196 ~__SSLManager ()
224197 {
225198 SSL_CTX_free (ssl_client_ctx_);
226-
227- #if OPENSSL_VERSION_NUMBER < 0x10100000L
228- // free ssl to avoid memory leak
229- FIPS_mode_set (0 );
230- CRYPTO_set_locking_callback (NULL );
231- # ifdef CRYPTO_LOCK_ECDH
232- CRYPTO_THREADID_set_callback (NULL );
233- # else
234- CRYPTO_set_id_callback (NULL );
235- # endif
236- ENGINE_cleanup ();
237- CONF_modules_unload (1 );
238- ERR_free_strings ();
239- EVP_cleanup ();
240- # ifdef CRYPTO_LOCK_ECDH
241- ERR_remove_thread_state (NULL );
242- # else
243- ERR_remove_state (0 );
244- # endif
245- CRYPTO_cleanup_all_ex_data ();
246- sk_SSL_COMP_free (SSL_COMP_get_compression_methods ());
247- delete [] __ssl_mutex;
248- #endif
249199 }
250200
251201private:
0 commit comments