Skip to content

Commit

Permalink
Fix enforce TLS version
Browse files Browse the repository at this point in the history
  • Loading branch information
sbiscigl committed Sep 8, 2023
1 parent acc3e9b commit c859aa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ if (LEGACY_BUILD)
if (DISABLE_INTERNAL_IMDSV1_CALLS)
add_definitions(-DDISABLE_IMDSV1)
endif ()
if (USE_TLS_V2)
if (USE_TLS_V1_2)
add_definitions(-DENFORCE_TLS_V1_2)
endif ()
if (USE_TLS_V3)
if (USE_TLS_V1_3)
add_definitions(-DENFORCE_TLS_V1_3)
endif ()

Expand Down
8 changes: 2 additions & 6 deletions src/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,17 +699,13 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<
curl_easy_setopt(connectionHandle, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(connectionHandle, CURLOPT_SSL_VERIFYHOST, 2L);

#if LIBCURL_VERSION_MAJOR >= 7
#if LIBCURL_VERSION_MINOR >= 34
#if defined(ENFORCE_TLS_V1_3)
#if defined(ENFORCE_TLS_V1_3) && LIBCURL_VERSION_NUM >= 0x073400 // 7.52.0
curl_easy_setopt(connectionHandle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_3);
#elif defined(ENFORCE_TLS_V1_2)
#elif defined(ENFORCE_TLS_V1_2) && LIBCURL_VERSION_NUM >= 0x072200 // 7.34.0
curl_easy_setopt(connectionHandle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
#else
curl_easy_setopt(connectionHandle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
#endif
#endif //LIBCURL_VERSION_MINOR
#endif //LIBCURL_VERSION_MAJOR
}
else
{
Expand Down

0 comments on commit c859aa7

Please sign in to comment.