diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 725b3a4f0..d74dbe807 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -30,6 +30,9 @@ - Changed the `Azure::Core::Http::HttpMethod` regular enum into an extensible enum class and removed the `HttpMethodToString()` helper method. - Removed `Azure::Core::Http::Request::GetHeadersAsString()`. - Introduced `Azure::Core::Context::Key` class which takes place of `std::string` used for `Azure::Core::Context` keys previously. +- Renamed type `Azure::Core::Http::CurlTransportSSLOptions` to `Azure::Core::Http::CurlTransportSslOptions`. +- Renamed member `Azure::Core::Http::CurlTransportOptions::SSLOptions` to `Azure::Core::Http::CurlTransportOptions::SslOptions`. +- Renamed member `Azure::Core::Http::CurlTransportOptions::SSLVerifyPeer` to `Azure::Core::Http::CurlTransportOptions::SslVerifyPeer`. ## 1.0.0-beta.7 (2021-03-11) diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index afb5ab0f3..e4dddfaed 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -21,7 +21,7 @@ namespace Azure { namespace Core { namespace Http { * https://curl.haxx.se/libcurl/c/CURLOPT_SSL_OPTIONS.html * */ - struct CurlTransportSSLOptions + struct CurlTransportSslOptions { /** * @brief This option can enable the revocation list check. @@ -79,7 +79,7 @@ namespace Azure { namespace Core { namespace Http { * https://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html * */ - bool SSLVerifyPeer = true; + bool SslVerifyPeer = true; /** * @brief Define the SSL options for the libcurl handle. @@ -88,7 +88,7 @@ namespace Azure { namespace Core { namespace Http { * The default option is all options `false`. * */ - CurlTransportSSLOptions SSLOptions; + CurlTransportSslOptions SslOptions; }; /** diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 8b114f694..95edbf5ba 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -1132,7 +1132,7 @@ inline std::string GetConnectionKey(std::string const& host, CurlTransportOption { key.append("0"); } - if (!options.SSLOptions.EnableCertificateRevocationListCheck) + if (!options.SslOptions.EnableCertificateRevocationListCheck) { key.append("1"); } @@ -1140,7 +1140,7 @@ inline std::string GetConnectionKey(std::string const& host, CurlTransportOption { key.append("0"); } - if (options.SSLVerifyPeer) + if (options.SslVerifyPeer) { key.append("1"); } @@ -1268,7 +1268,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo } long sslOption = 0; - if (!options.SSLOptions.EnableCertificateRevocationListCheck) + if (!options.SslOptions.EnableCertificateRevocationListCheck) { sslOption |= CURLSSLOPT_NO_REVOKE; } @@ -1281,7 +1281,7 @@ std::unique_ptr CurlConnectionPool::ExtractOrCreateCurlCo + std::string(curl_easy_strerror(result))); } - if (!options.SSLVerifyPeer) + if (!options.SslVerifyPeer) { if (!SetLibcurlOption(newHandle, CURLOPT_SSL_VERIFYPEER, 0L, &result)) { diff --git a/sdk/core/azure-core/test/ut/curl_connection_pool.cpp b/sdk/core/azure-core/test/ut/curl_connection_pool.cpp index dcd8156ef..d021bef2c 100644 --- a/sdk/core/azure-core/test/ut/curl_connection_pool.cpp +++ b/sdk/core/azure-core/test/ut/curl_connection_pool.cpp @@ -89,7 +89,7 @@ namespace Azure { namespace Core { namespace Test { { // Creating a new connection with options Azure::Core::Http::CurlTransportOptions options; - options.SSLVerifyPeer = false; + options.SslVerifyPeer = false; auto connection = Azure::Core::Http::CurlConnectionPool::ExtractOrCreateCurlConnection(req, options); EXPECT_EQ(connection->GetConnectionKey(), secondExpectedKey); diff --git a/sdk/core/azure-core/test/ut/curl_options.cpp b/sdk/core/azure-core/test/ut/curl_options.cpp index 71f27cbb8..19c1920f4 100644 --- a/sdk/core/azure-core/test/ut/curl_options.cpp +++ b/sdk/core/azure-core/test/ut/curl_options.cpp @@ -62,7 +62,7 @@ namespace Azure { namespace Core { namespace Test { TEST(CurlTransportOptions, noRevoke) { Azure::Core::Http::CurlTransportOptions curlOptions; - curlOptions.SSLOptions.EnableCertificateRevocationListCheck = true; + curlOptions.SslOptions.EnableCertificateRevocationListCheck = true; auto transportAdapter = std::make_shared(curlOptions); Azure::Core::Http::Policies::TransportOptions options; @@ -98,7 +98,7 @@ namespace Azure { namespace Core { namespace Test { TEST(CurlTransportOptions, nativeCA) { Azure::Core::Http::CurlTransportOptions curlOptions; - curlOptions.SSLOptions.NativeCa = true; + curlOptions.SslOptions.NativeCa = true; auto transportAdapter = std::make_shared(curlOptions); auto transportPolicy = @@ -124,7 +124,7 @@ namespace Azure { namespace Core { namespace Test { TEST(CurlTransportOptions, noPartialChain) { Azure::Core::Http::CurlTransportOptions curlOptions; - curlOptions.SSLOptions.NoPartialchain = true; + curlOptions.SslOptions.NoPartialchain = true; auto transportAdapter = std::make_shared(curlOptions); auto transportPolicy = @@ -150,7 +150,7 @@ namespace Azure { namespace Core { namespace Test { TEST(CurlTransportOptions, bestEffort) { Azure::Core::Http::CurlTransportOptions curlOptions; - curlOptions.SSLOptions.RevokeBestEffort = true; + curlOptions.SslOptions.RevokeBestEffort = true; auto transportAdapter = std::make_shared(curlOptions); auto transportPolicy = @@ -177,7 +177,7 @@ namespace Azure { namespace Core { namespace Test { { Azure::Core::Http::CurlTransportOptions curlOptions; // If ssl verify is not disabled, this test would fail because the caInfo is not OK - curlOptions.SSLVerifyPeer = false; + curlOptions.SslVerifyPeer = false; // This ca info should be ignored by verify disable and test should work curlOptions.CAInfo = "/";