THRIFT-5821: support building against AWS-LC
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index b59292c..b938d7c 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -87,7 +87,7 @@
# OpenSSL
if(WITH_CPP OR WITH_C_GLIB)
- find_package(OpenSSL QUIET)
+ find_package(OpenSSL)
CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON
"OPENSSL_FOUND" OFF)
endif()
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
index 26ae2be..da8b027 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -152,10 +152,12 @@
#if (OPENSSL_VERSION_NUMBER < OPENSSL_ENGINE_CLEANUP_REQUIRED_BEFORE)
ENGINE_cleanup(); // https://www.openssl.org/docs/man1.1.0/crypto/ENGINE_cleanup.html - cleanup call is needed before 1.1.0
#endif
+#if !defined(OPENSSL_IS_AWSLC)
CONF_modules_unload(1);
+#endif
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
+#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_IS_AWSLC)
// https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_thread_stop.html
OPENSSL_thread_stop();
#else
@@ -393,7 +395,7 @@
SSL_free(ssl_);
ssl_ = nullptr;
handshakeCompleted_ = false;
-#if OPENSSL_VERSION_NUMBER >= 0x10100000
+#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_IS_AWSLC)
// https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_thread_stop.html
OPENSSL_thread_stop();
#else