diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake index b59292cd3b9..b938d7c3542 100644 --- a/build/cmake/DefineOptions.cmake +++ b/build/cmake/DefineOptions.cmake @@ -87,7 +87,7 @@ CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON # 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 26ae2beda44..da8b027c6c3 100644 --- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp +++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp @@ -152,10 +152,12 @@ void cleanupOpenSSL() { #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 @@ void TSSLSocket::close() { 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