Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 81f36e7174097a1f1f3e7f94a97574b2ec68577f Mon Sep 17 00:00:00 2001 |
| 2 | From: "James E. King, III" <jim.king@simplivity.com> |
| 3 | Date: Thu, 29 Sep 2016 15:04:09 -0400 |
| 4 | Subject: [PATCH] THRIFT-3878: fix interop with newer OpenSSL libraries |
| 5 | |
| 6 | --- |
| 7 | lib/cpp/src/thrift/transport/TSSLSocket.cpp | 5 +++++ |
| 8 | 1 file changed, 5 insertions(+) |
| 9 | |
| 10 | diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp |
| 11 | index 3da9e45..0a3a124 100644 |
| 12 | --- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp |
| 13 | +++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp |
| 14 | @@ -97,7 +97,12 @@ void initializeOpenSSL() { |
| 15 | SSL_library_init(); |
| 16 | SSL_load_error_strings(); |
| 17 | // static locking |
| 18 | + // newer versions of OpenSSL changed CRYPTO_num_locks - see THRIFT-3878 |
| 19 | +#ifdef CRYPTO_num_locks |
| 20 | + mutexes = boost::shared_array<Mutex>(new Mutex[CRYPTO_num_locks()]); |
| 21 | +#else |
| 22 | mutexes = boost::shared_array<Mutex>(new Mutex[ ::CRYPTO_num_locks()]); |
| 23 | +#endif |
| 24 | if (mutexes == NULL) { |
| 25 | throw TTransportException(TTransportException::INTERNAL_ERROR, |
| 26 | "initializeOpenSSL() failed, " |