From 5f523f7030459bc8ca77b0ac96ff3f2c7b593d03 Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Wed, 17 Feb 2021 18:16:22 -0800 Subject: [PATCH] update noRevoke (#1678) * update noRevoke * use EnableCertificateRevocationListCheck instead of Disable --- sdk/core/azure-core/CHANGELOG.md | 1 + sdk/core/azure-core/inc/azure/core/http/curl/curl.hpp | 4 ++-- sdk/core/azure-core/src/http/curl/curl.cpp | 4 ++-- sdk/core/azure-core/test/ut/curl_options.cpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 83c273b3f..e3ce9aee7 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -7,6 +7,7 @@ - Removed `Azure::Core::Http::HttpPipeline` by making it internal, used only within the SDK. - Split `Azure::Core::RequestConditions` into `Azure::Core::MatchConditions` and `Azure::Core::ModifiedConditions`. - Removed `TransportKind` enum from `Azure::Core::Http`. +- Renamed `NoRevoke` to `EnableCertificateRevocationListCheck` for `Azure::Core::Http::CurlTransportSSLOptions`. - Renamed `GetString()` to `ToString()` in `Azure::Core::DateTime`. - Renamed `GetUuidString()` tp `ToString()` in `Azure::Core::Uuid`. diff --git a/sdk/core/azure-core/inc/azure/core/http/curl/curl.hpp b/sdk/core/azure-core/inc/azure/core/http/curl/curl.hpp index 9834316f3..b730193b9 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl/curl.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl/curl.hpp @@ -24,14 +24,14 @@ namespace Azure { namespace Core { namespace Http { struct CurlTransportSSLOptions { /** - * @brief This option can disable the revocation list check. + * @brief This option can enable the revocation list check. * * @remark Libcurl does revocation list check by default for ssl backends that supports this * feature. However, the Azure SDK overrides libcurl's behavior and disables the revocation list * check by default. * */ - bool NoRevoke = true; + bool EnableCertificateRevocationListCheck = false; }; /** diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 7542492f4..a00f6d045 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -1077,7 +1077,7 @@ inline std::string GetConnectionKey(std::string const& host, CurlTransportOption { key.append("0"); } - if (options.SSLOptions.NoRevoke) + if (!options.SSLOptions.EnableCertificateRevocationListCheck) { key.append("1"); } @@ -1202,7 +1202,7 @@ std::unique_ptr CurlConnectionPool::GetCurlConnection( } long sslOption = 0; - if (options.SSLOptions.NoRevoke) + if (!options.SSLOptions.EnableCertificateRevocationListCheck) { sslOption |= CURLSSLOPT_NO_REVOKE; } diff --git a/sdk/core/azure-core/test/ut/curl_options.cpp b/sdk/core/azure-core/test/ut/curl_options.cpp index 4a5d126da..1c2171c9b 100644 --- a/sdk/core/azure-core/test/ut/curl_options.cpp +++ b/sdk/core/azure-core/test/ut/curl_options.cpp @@ -58,7 +58,7 @@ namespace Azure { namespace Core { namespace Test { TEST(CurlTransportOptions, noRevoke) { Azure::Core::Http::CurlTransportOptions curlOptions; - curlOptions.SSLOptions.NoRevoke = true; + curlOptions.SSLOptions.EnableCertificateRevocationListCheck = true; auto transportAdapter = std::make_shared(curlOptions); Azure::Core::Http::TransportPolicyOptions options;