diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index 063994573..d85c55b39 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -176,8 +176,6 @@ namespace Azure { namespace Core { namespace Http { std::unique_ptr SendRequestAndGetResponse( std::unique_ptr<_detail::HandleManager> handleManager, HttpMethod requestMethod); - // This option can be set only using context option - bool m_noClientCert = false; public: /** diff --git a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp index 1733a5987..1e61ffafa 100644 --- a/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp +++ b/sdk/core/azure-core/src/http/winhttp/win_http_transport.cpp @@ -360,7 +360,11 @@ void WinHttpTransport::CreateRequestHandle(std::unique_ptr<_detail::HandleManage } // Option is set up by context settings only and is only available for SDK clients - if (m_noClientCert) + using namespace Azure::Core::Http::_internal; + auto noClientCert = WinHttpTransportContextProvider::HasNoClientCertificateConfiguration( + handleManager->m_context); + + if (noClientCert) { // If the service requests TLS client certificates, we want to let the WinHTTP APIs know that // it's ok to initiate the request without a client certificate. @@ -672,9 +676,6 @@ std::unique_ptr WinHttpTransport::SendRequestAndGetResponse( std::unique_ptr WinHttpTransport::Send(Request& request, Context const& context) { - using namespace Azure::Core::Http::_internal; - m_noClientCert = WinHttpTransportContextProvider::HasNoClientCertificateConfiguration(context); - auto handleManager = std::make_unique<_detail::HandleManager>(request, context); CreateSessionHandle(handleManager);