Skip to content

Commit 3701143

Browse files
andrewkdinhjogme
authored andcommitted
Fix ssl_poll_perf perftool in CI
Use SSL_set1_dnsname if available. If not, fallback to SSL_set1_host Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Norbert Pocs <norbertp@openssl.org> MergeDate: Fri Feb 27 17:55:27 2026 (Merged from #82)
1 parent db080f7 commit 3701143

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

source/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ endif()
155155
target_include_directories(perf PUBLIC "${PROJECT_SOURCE_DIR}")
156156
target_link_libraries(perf PUBLIC OpenSSL::SSL OpenSSL::Crypto)
157157
set(CMAKE_REQUIRED_LIBRARIES OpenSSL::Crypto)
158+
set(CMAKE_REQUIRED_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
158159
set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
159160

160161
if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 )
@@ -167,6 +168,7 @@ if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 )
167168
endif()
168169

169170
check_symbol_exists(OSSL_LIB_CTX_freeze "openssl/crypto.h" HAVE_OSSL_LIB_CTX_FREEZE)
171+
check_symbol_exists(SSL_set1_dnsname "openssl/ssl.h" HAVE_SSL_SET1_DNSNAME)
170172

171173
if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3.6 )
172174
add_executable(ssl_poll_perf ssl_poll_perf.c)

source/config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
/* Define to 1 if you have the `OSSL_LIB_CTX_freeze' function. */
44
#cmakedefine HAVE_OSSL_LIB_CTX_FREEZE
5+
6+
/* Define to 1 if you have the `SSL_set1_dnsname' function. */
7+
#cmakedefine HAVE_SSL_SET1_DNSNAME

source/ssl_poll_perf.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <openssl/quic.h>
5050
#include "perflib/perflib.h"
5151
#include "perflib/list.h"
52+
#include "config.h"
5253

5354
#ifndef _WIN32
5455
# include <unistd.h>
@@ -2981,10 +2982,17 @@ create_client_pe(SSL_CTX *ctx, struct client_stats *cs)
29812982
goto fail;
29822983
}
29832984

2985+
#ifdef HAVE_SSL_SET1_DNSNAME
2986+
if (SSL_set1_dnsname(qconn, hostname) == 0) {
2987+
DPRINTFC(stderr, "%s SSL_set1_dnsname() failed\n", __func__);
2988+
goto fail;
2989+
}
2990+
#else
29842991
if (SSL_set1_host(qconn, hostname) == 0) {
29852992
DPRINTFC(stderr, "%s SSL_set1_host() failed\n", __func__);
29862993
goto fail;
29872994
}
2995+
#endif
29882996

29892997
/* SSL_set_alpn_protos returns 0 for success! */
29902998
switch (alpn) {

0 commit comments

Comments
 (0)