Skip to content

Commit d1ea858

Browse files
authored
Fix: Build with OpenSSL 3.5+ which removed engine API (#12902)
* Guard engine.h include with HAVE_ENGINE_LOAD_DYNAMIC -- OpenSSL 3.5 removed the header entirely; only include it when cmake detected the ENGINE API is available. * Fix check_symbol_exists header path from "include/openssl/engine.h" to "openssl/engine.h" for consistency with all other OpenSSL checks.
1 parent 27a8e57 commit d1ea858

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,9 @@ check_symbol_exists(SSL_get_all_async_fds openssl/ssl.h TS_USE_TLS_ASYNC)
545545
check_symbol_exists(OSSL_PARAM_construct_end "openssl/params.h" HAVE_OSSL_PARAM_CONSTRUCT_END)
546546
check_symbol_exists(TLS1_3_VERSION "openssl/ssl.h" TS_USE_TLS13)
547547
check_symbol_exists(MD5_Init "openssl/md5.h" HAVE_MD5_INIT)
548-
check_symbol_exists(ENGINE_load_dynamic "include/openssl/engine.h" HAVE_ENGINE_LOAD_DYNAMIC)
549-
check_symbol_exists(ENGINE_get_default_RSA "include/openssl/engine.h" HAVE_ENGINE_GET_DEFAULT_RSA)
550-
check_symbol_exists(ENGINE_load_private_key "include/openssl/engine.h" HAVE_ENGINE_LOAD_PRIVATE_KEY)
548+
check_symbol_exists(ENGINE_load_dynamic "openssl/engine.h" HAVE_ENGINE_LOAD_DYNAMIC)
549+
check_symbol_exists(ENGINE_get_default_RSA "openssl/engine.h" HAVE_ENGINE_GET_DEFAULT_RSA)
550+
check_symbol_exists(ENGINE_load_private_key "openssl/engine.h" HAVE_ENGINE_LOAD_PRIVATE_KEY)
551551
check_symbol_exists(sysctlbyname "sys/sysctl.h" HAVE_SYSCTLBYNAME)
552552

553553
if(SSLLIB_IS_OPENSSL3)

src/iocore/net/SSLUtils.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
#include <openssl/conf.h>
5555
#include <openssl/dh.h>
5656
#include <openssl/ec.h>
57+
#if HAVE_ENGINE_LOAD_DYNAMIC
5758
#include <openssl/engine.h>
59+
#endif
5860
#include <openssl/err.h>
5961
#include <openssl/evp.h>
6062
#include <openssl/objects.h>

0 commit comments

Comments
 (0)