]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: improve error message for invalid HTTP/3 MultiSSL configs
authorViktor Szakats <commit@vsz.me>
Mon, 11 Aug 2025 21:47:03 +0000 (23:47 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 12 Aug 2025 09:49:01 +0000 (11:49 +0200)
Error out for these combinations before trying to detect HTTP/3
dependencies, for a clearer error message.

Reported-by: Daniel Engberg
Fixes https://github.com/curl/curl/issues/18246
Closes https://github.com/curl/curl/issues/18256

CMakeLists.txt

index c12d2bcc18320e876ab7002f108e828b47a377b9..50db8602d7f42edac4ecc2e45e5ef067da330365 100644 (file)
@@ -1093,7 +1093,9 @@ endif()
 
 option(USE_NGTCP2 "Use ngtcp2 and nghttp3 libraries for HTTP/3 support" OFF)
 if(USE_NGTCP2)
-  if(USE_OPENSSL OR USE_WOLFSSL)
+  if(CURL_WITH_MULTI_SSL)
+    message(FATAL_ERROR "MultiSSL cannot be enabled with HTTP/3 and vice versa.")
+  elseif(USE_OPENSSL OR USE_WOLFSSL)
     if(USE_WOLFSSL)
       find_package(NGTCP2 REQUIRED "wolfSSL")
     elseif(HAVE_BORINGSSL OR HAVE_AWSLC)
@@ -1141,6 +1143,8 @@ option(USE_QUICHE "Use quiche library for HTTP/3 support" OFF)
 if(USE_QUICHE)
   if(USE_NGTCP2)
     message(FATAL_ERROR "Only one HTTP/3 backend can be selected")
+  elseif(CURL_WITH_MULTI_SSL)
+    message(FATAL_ERROR "MultiSSL cannot be enabled with HTTP/3 and vice versa.")
   endif()
   find_package(Quiche REQUIRED)
   if(NOT HAVE_BORINGSSL)
@@ -1167,6 +1171,8 @@ endif()
 if(USE_OPENSSL_QUIC)
   if(USE_NGTCP2 OR USE_QUICHE)
     message(FATAL_ERROR "Only one HTTP/3 backend can be selected")
+  elseif(CURL_WITH_MULTI_SSL)
+    message(FATAL_ERROR "MultiSSL cannot be enabled with HTTP/3 and vice versa.")
   endif()
   find_package(OpenSSL 3.3.0 REQUIRED)
 
@@ -1182,10 +1188,6 @@ if(USE_OPENSSL_QUIC)
   endif()
 endif()
 
-if(CURL_WITH_MULTI_SSL AND (USE_NGTCP2 OR USE_QUICHE OR USE_OPENSSL_QUIC))
-  message(FATAL_ERROR "MultiSSL cannot be enabled with HTTP/3 and vice versa.")
-endif()
-
 if(NOT CURL_DISABLE_SRP AND (HAVE_GNUTLS_SRP OR HAVE_OPENSSL_SRP))
   set(USE_TLS_SRP 1)
 endif()