diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp b/lib/cpp/src/thrift/transport/TSSLSocket.cpp index da8b027c6c..66517f782f 100644 --- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp +++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp @@ -152,14 +152,16 @@ 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) +#if !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_IS_AWSLC) CONF_modules_unload(1); #endif EVP_cleanup(); CRYPTO_cleanup_all_ex_data(); -#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_IS_AWSLC) +#if OPENSSL_VERSION_NUMBER >= 0x10100000 +# if !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_IS_AWSLC) // https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_thread_stop.html OPENSSL_thread_stop(); +# endif #else // ERR_remove_state() was deprecated in OpenSSL 1.0.0 and ERR_remove_thread_state() // was deprecated in OpenSSL 1.1.0; these functions and should not be used. @@ -395,9 +397,11 @@ void TSSLSocket::close() { SSL_free(ssl_); ssl_ = nullptr; handshakeCompleted_ = false; -#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_IS_AWSLC) +#if OPENSSL_VERSION_NUMBER >= 0x10100000 +# if !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_IS_AWSLC) // https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_thread_stop.html OPENSSL_thread_stop(); +# endif #else // ERR_remove_state() was deprecated in OpenSSL 1.0.0 and ERR_remove_thread_state() // was deprecated in OpenSSL 1.1.0; these functions and should not be used.