From a33d09f80bf698e98e4674e5e59c56813cc65d41 Mon Sep 17 00:00:00 2001 From: paldier Date: Thu, 28 Oct 2021 09:24:49 +0800 Subject: [PATCH] fix openssl1.1 without 0.9.8 api compile error when `./Configure --api=1.0.0`, we should not use CRYPTO_set_id_callback(). --- src/util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util.c b/src/util.c index 5c9dafb..aa9b102 100644 --- a/src/util.c +++ b/src/util.c @@ -738,7 +738,11 @@ void SSL_CRYPTO_thread_setup(void) pthread_mutex_init(&(lock_cs[i]), NULL); } +#if OPENSSL_API_COMPAT < 0x10000000 CRYPTO_set_id_callback(_pthreads_thread_id); +#else + CRYPTO_THREADID_set_callback(_pthreads_thread_id); +#endif CRYPTO_set_locking_callback(_pthreads_locking_callback); }