From fc639823d23d1090b8b8dcb4dd65005b41c6a8de Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 29 Feb 2024 14:44:30 -0500 Subject: cmCurl: Factor out compatibility code for curl < 7.52 --- Source/cmCurl.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx index e57e55d..5127110 100644 --- a/Source/cmCurl.cxx +++ b/Source/cmCurl.cxx @@ -34,6 +34,11 @@ } \ } while (false) +// curl versions before 7.52.0 did not provide TLS 1.3 support +#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM < 0x073400 +# define CURL_SSLVERSION_TLSv1_3 CURL_SSLVERSION_LAST +#endif + cm::optional cmCurlParseTLSVersion(cm::string_view tls_version) { cm::optional v; @@ -44,12 +49,7 @@ cm::optional cmCurlParseTLSVersion(cm::string_view tls_version) } else if (tls_version == "1.2"_s) { v = CURL_SSLVERSION_TLSv1_2; } else if (tls_version == "1.3"_s) { - // curl version 7.52.0 introduced TLS 1.3 support -#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM >= 0x073400 v = CURL_SSLVERSION_TLSv1_3; -#else - v = CURL_SSLVERSION_LAST; -#endif } return v; } -- cgit v0.12