Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build with OpenSSL 3.1 #3929

Merged
merged 1 commit into from
Oct 19, 2023
Merged
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
8 changes: 6 additions & 2 deletions submodules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if(QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "openssl3")
set(QUIC_OPENSSL openssl)
else()
set(QUIC_USE_OPENSSL3 ON)
message(STATUS "Configuring for OpenSSL 3.0")
message(STATUS "Configuring for OpenSSL 3.x")
set(EXPECTED_OPENSSL_VERSION 3.0)
set(QUIC_OPENSSL openssl3)
endif()
Expand Down Expand Up @@ -343,7 +343,11 @@ else()
# We cannot use VERSION_GREATER as 3.0 would work for 1.1.1 but they are not compatible.
string(FIND ${OPENSSL_VERSION} "." VERSIONLEN REVERSE)
string(SUBSTRING ${OPENSSL_VERSION} 0 ${VERSIONLEN} OPENSSL_MAJORMINOR)
if (OPENSSL_VERSION VERSION_EQUAL EXPECTED_OPENSSL_VERSION OR OPENSSL_MAJORMINOR VERSION_EQUAL EXPECTED_OPENSSL_VERSION)
string(FIND ${OPENSSL_VERSION} "." VERSIONLEN)
string(SUBSTRING ${OPENSSL_VERSION} 0 ${VERSIONLEN} OPENSSL_MAJOR)
if (OPENSSL_VERSION VERSION_EQUAL EXPECTED_OPENSSL_VERSION OR OPENSSL_MAJORMINOR VERSION_EQUAL EXPECTED_OPENSSL_VERSION OR
# 3.1 is compatible with 3.0, 3.2 and beyond maybe as well.
(EXPECTED_OPENSSL_VERSION VERSION_EQUAL "3.0" AND OPENSSL_MAJOR EQUAL "3"))
target_link_libraries(OpenSSLQuic INTERFACE OpenSSL::Crypto)
else()
message(FATAL_ERROR "OpenSSL ${EXPECTED_OPENSSL_VERSION} not found, found ${OPENSSL_VERSION}")
Expand Down