Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Release/src/http/client/http_client_winhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down