Utilities: Avoid OpenSSL version check under forks

When finding BoringSSL, LibreSSL, or AWS-LC, version information may be
unavailable. Amend commit 54686cae64 (Utilities: Require OpenSSL >=
3.0.0 at configure time, 2026-06-26) by using the checks from upstream
curl to only error if we're using OpenSSL proper.

Fixes: #27978
This commit is contained in:
Tyler Yankee
2026-07-21 18:51:08 -04:00
parent ef1b774172
commit 15266bf2a4
2 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ else()
set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle")
set(CURL_CA_PATH "" CACHE PATH "Path to SSL CA Certificate Directory")
mark_as_advanced(CURL_CA_BUNDLE CURL_CA_PATH)
find_package(OpenSSL 3.0.0)
find_package(OpenSSL)
endif()
if(NOT CMAKE_USE_SYSTEM_NGHTTP2)
# Tell curl's FindNGHTTP2 module to use our library.
+12 -1
View File
@@ -1011,7 +1011,7 @@ if(_use_core_foundation_and_core_services)
endif()
if(CURL_USE_OPENSSL)
find_package(OpenSSL 3.0.0)
find_package(OpenSSL)
if(NOT OpenSSL_FOUND)
message(FATAL_ERROR
"Could not find OpenSSL. Install an OpenSSL development package or "
@@ -1042,6 +1042,17 @@ if(CURL_USE_OPENSSL)
endif()
cmake_pop_check_state()
if(NOT HAVE_BORINGSSL AND NOT HAVE_AWSLC AND NOT HAVE_LIBRESSL)
# Under forks of OpenSSL, we cannot guarantee that version information
# will be available.
if(OPENSSL_VERSION VERSION_LESS 3.0.0)
message(FATAL_ERROR
"Found OpenSSL version ${OPENSSL_VERSION}. When building CMake with "
"vendored curl, at least version 3.0.0 is required, or configure "
"CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.")
endif()
endif()
# Optionally build with a specific CA cert bundle.
if(CURL_CA_BUNDLE)
add_definitions(-DCURL_CA_BUNDLE="${CURL_CA_BUNDLE}")