From d69ab179d5eac008f0b2b72bed50846c3cddb1ed Mon Sep 17 00:00:00 2001 From: Andrew Dinh Date: Fri, 27 Feb 2026 17:09:17 +0700 Subject: [PATCH 1/2] Fix ssl_poll_perf perftool in CI Use SSL_set1_dnsname if available. If not, fallback to SSL_set1_host --- source/CMakeLists.txt | 2 ++ source/config.h.in | 3 +++ source/ssl_poll_perf.c | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 1055c9a..71cb979 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -155,6 +155,7 @@ endif() target_include_directories(perf PUBLIC "${PROJECT_SOURCE_DIR}") target_link_libraries(perf PUBLIC OpenSSL::SSL OpenSSL::Crypto) set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto) +set(CMAKE_REQUIRED_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}") if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 ) @@ -167,6 +168,7 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 ) endif() check_symbol_exists(OSSL_LIB_CTX_freeze "openssl/crypto.h" HAVE_OSSL_LIB_CTX_FREEZE) +check_symbol_exists(SSL_set1_dnsname "openssl/ssl.h" HAVE_SSL_SET1_DNSNAME) if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3.6 ) add_executable(ssl_poll_perf ssl_poll_perf.c) diff --git a/source/config.h.in b/source/config.h.in index 80bc9ea..90e79ad 100644 --- a/source/config.h.in +++ b/source/config.h.in @@ -2,3 +2,6 @@ /* Define to 1 if you have the `OSSL_LIB_CTX_freeze' function. */ #cmakedefine HAVE_OSSL_LIB_CTX_FREEZE + +/* Define to 1 if you have the `SSL_set1_dnsname' function. */ +#cmakedefine HAVE_SSL_SET1_DNSNAME diff --git a/source/ssl_poll_perf.c b/source/ssl_poll_perf.c index e17f3b2..77c1ca4 100644 --- a/source/ssl_poll_perf.c +++ b/source/ssl_poll_perf.c @@ -29,6 +29,7 @@ #include #include +#include "config.h" /* Include the appropriate header file for SOCK_STREAM */ #ifdef _WIN32 /* Windows */ # include @@ -2981,10 +2982,17 @@ create_client_pe(SSL_CTX *ctx, struct client_stats *cs) goto fail; } +#ifdef HAVE_SSL_SET1_DNSNAME + if (SSL_set1_dnsname(qconn, hostname) == 0) { + DPRINTFC(stderr, "%s SSL_set1_dnsname() failed\n", __func__); + goto fail; + } +#else if (SSL_set1_host(qconn, hostname) == 0) { DPRINTFC(stderr, "%s SSL_set1_host() failed\n", __func__); goto fail; } +#endif /* SSL_set_alpn_protos returns 0 for success! */ switch (alpn) { From eda5b1cfc5f0a2111288c848795cf5fbec639b6c Mon Sep 17 00:00:00 2001 From: Andrew Dinh Date: Fri, 27 Feb 2026 23:43:46 +0700 Subject: [PATCH 2/2] fixup! Fix ssl_poll_perf perftool in CI --- source/ssl_poll_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ssl_poll_perf.c b/source/ssl_poll_perf.c index 77c1ca4..f54910d 100644 --- a/source/ssl_poll_perf.c +++ b/source/ssl_poll_perf.c @@ -29,7 +29,6 @@ #include #include -#include "config.h" /* Include the appropriate header file for SOCK_STREAM */ #ifdef _WIN32 /* Windows */ # include @@ -50,6 +49,7 @@ #include #include "perflib/perflib.h" #include "perflib/list.h" +#include "config.h" #ifndef _WIN32 # include