Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions source/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions source/ssl_poll_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <openssl/quic.h>
#include "perflib/perflib.h"
#include "perflib/list.h"
#include "config.h"

#ifndef _WIN32
# include <unistd.h>
Expand Down Expand Up @@ -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) {
Expand Down
Loading