summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tls.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tls.c b/tls.c
index 7b33d8e..366286f 100644
--- a/tls.c
+++ b/tls.c
@@ -232,9 +232,13 @@ tls_init ()
{
SSL_load_error_strings ();
#if defined HAVE_PTHREADS
- if (CRYPTO_get_locking_callback () == NULL)
+ /* OpenSSL 1.1 removed the locking functions and finally implemented
+ * its own thread safety. In this case the locking callback will
+ * return null even after we initialize it. So if we have already
+ * allocated mutexes, don't consider that a failure.
+ */
+ if ((CRYPTO_get_locking_callback () == NULL) || (s_openssl_mutexes_count > 0))
{
- assert (s_openssl_mutexes_count == 0);
/* Allocate and initialise mutexes. We will never free
these. FIXME: Is there a portable way of having a function
invoked when a solib is unloaded? -ln */