diff --git a/Release/src/http/client/http_client_winhttp.cpp b/Release/src/http/client/http_client_winhttp.cpp index 52bf771a16..d0bea3284e 100644 --- a/Release/src/http/client/http_client_winhttp.cpp +++ b/Release/src/http/client/http_client_winhttp.cpp @@ -437,17 +437,6 @@ class winhttp_client : public _http_client_communicator } } -#if 0 // Work in progress. Enable this to support server certificate revocation check - if( m_secure ) - { - DWORD dwEnableSSLRevocOpt = WINHTTP_ENABLE_SSL_REVOCATION; - if(!WinHttpSetOption(m_hSession, WINHTTP_OPTION_ENABLE_FEATURE, &dwEnableSSLRevocOpt, sizeof(dwEnableSSLRevocOpt))) - { - DWORD dwError = GetLastError(); dwError; - return report_failure(U("Error enabling SSL revocation check")); - } - } -#endif //Enable TLS 1.1 and 1.2 #if !defined(CPPREST_TARGET_XP) BOOL win32_result(FALSE); @@ -542,6 +531,18 @@ class winhttp_client : public _http_client_communicator return; } + // Enable the certificate revocation check + if (m_secure) + { + DWORD dwEnableSSLRevocOpt = WINHTTP_ENABLE_SSL_REVOCATION; + if (!WinHttpSetOption(winhttp_context->m_request_handle, WINHTTP_OPTION_ENABLE_FEATURE, &dwEnableSSLRevocOpt, sizeof(dwEnableSSLRevocOpt))) + { + auto errorCode = GetLastError(); + request->report_error(errorCode, build_error_msg(errorCode, "Error enabling SSL revocation check")); + return; + } + } + if(proxy_info_required) { auto result = WinHttpSetOption(