mirror of
https://github.com/curl/curl.git
synced 2026-05-30 09:47:29 +03:00
cmake: fix OpenSSL quic detection in quiche builds
An orphan call to `CheckQuicSupportInOpenSSL()` remained after a recent
update when checking QUIC for quiche. Move back QUIC detection to
a function and fixup callers to use that. Also make sure that quiche
gets QUIC from BoringSSL, because it doesn't support other forks at this
time.
Regression from dee310d542 #11555
Reported-by: Casey Bodley <cbodley@redhat.com>
Fixes #12160
Closes #12162
This commit is contained in:
parent
0bd9164b85
commit
514969db04
1 changed files with 19 additions and 13 deletions
|
|
@ -650,6 +650,20 @@ macro(openssl_check_symbol_exists SYMBOL FILES VARIABLE)
|
|||
cmake_pop_check_state()
|
||||
endmacro()
|
||||
|
||||
# Ensure that the OpenSSL fork actually supports QUIC.
|
||||
macro(openssl_check_quic)
|
||||
if(NOT DEFINED HAVE_SSL_CTX_SET_QUIC_METHOD)
|
||||
if(USE_OPENSSL)
|
||||
openssl_check_symbol_exists(SSL_CTX_set_quic_method "openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD)
|
||||
elseif(USE_WOLFSSL)
|
||||
openssl_check_symbol_exists(wolfSSL_set_quic_method "wolfssl/options.h;wolfssl/openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT HAVE_SSL_CTX_SET_QUIC_METHOD)
|
||||
message(FATAL_ERROR "QUIC support is missing in OpenSSL fork. Try setting -DOPENSSL_ROOT_DIR")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(USE_OPENSSL OR USE_WOLFSSL)
|
||||
if(NOT DEFINED HAVE_SSL_SET0_WBIO)
|
||||
openssl_check_symbol_exists(SSL_set0_wbio "openssl/ssl.h" HAVE_SSL_SET0_WBIO)
|
||||
|
|
@ -676,18 +690,7 @@ if(USE_NGTCP2)
|
|||
else()
|
||||
find_package(NGTCP2 REQUIRED quictls)
|
||||
endif()
|
||||
|
||||
# Be sure that the OpenSSL/wolfSSL library actually supports QUIC.
|
||||
if(NOT DEFINED HAVE_SSL_CTX_SET_QUIC_METHOD)
|
||||
if(USE_OPENSSL)
|
||||
openssl_check_symbol_exists(SSL_CTX_set_quic_method "openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD)
|
||||
elseif(USE_WOLFSSL)
|
||||
openssl_check_symbol_exists(wolfSSL_set_quic_method "wolfssl/options.h;wolfssl/openssl/ssl.h" HAVE_SSL_CTX_SET_QUIC_METHOD)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT HAVE_SSL_CTX_SET_QUIC_METHOD)
|
||||
message(FATAL_ERROR "QUIC support is missing in OpenSSL/LibreSSL/BoringSSL/wolfSSL. Try setting -DOPENSSL_ROOT_DIR")
|
||||
endif()
|
||||
openssl_check_quic()
|
||||
elseif(USE_GNUTLS)
|
||||
find_package(NGTCP2 REQUIRED GnuTLS)
|
||||
else()
|
||||
|
|
@ -709,7 +712,10 @@ if(USE_QUICHE)
|
|||
message(FATAL_ERROR "Only one HTTP/3 backend can be selected!")
|
||||
endif()
|
||||
find_package(QUICHE REQUIRED)
|
||||
CheckQuicSupportInOpenSSL()
|
||||
if(NOT HAVE_BORINGSSL)
|
||||
message(FATAL_ERROR "quiche requires BoringSSL")
|
||||
endif()
|
||||
openssl_check_quic()
|
||||
set(USE_QUICHE ON)
|
||||
include_directories(${QUICHE_INCLUDE_DIRS})
|
||||
list(APPEND CURL_LIBS ${QUICHE_LIBRARIES})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue