mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
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:
@@ -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.
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user