Skip to content

Commit ace26dd

Browse files
authored
[Feature] Set CURLSSLOPT_REVOKE_BEST_EFFORT (#3831)
* [Feature] Set CURLSSLOPT_REVOKE_BEST_EFFORT * [Feature] Set CURLSSLOPT_REVOKE_BEST_EFFORT * [Feature] Set CURLSSLOPT_REVOKE_BEST_EFFORT * changed the naming of config, and changed comment, and changed unreferenced to void * added a warning for the config and changed it to not be windows only
1 parent 287b5bf commit ace26dd

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

src/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,17 @@ namespace Aws
488488
bool useAnonymousAuth = false;
489489
} winHTTPOptions;
490490

491+
/**
492+
* Configuration that is specifically used for the curl http client
493+
*/
494+
struct CurlOptions {
495+
/**
496+
* If set to true, SSL connections will use best-effort revocation checking,
497+
* proceeding even when CRL servers are unreachable. Off by default.
498+
*/
499+
bool revokeBestEffort = false;
500+
} curlOptions;
501+
491502
/**
492503
* The AWS account ID. Used for account-based endpoint routing. An AWS account ID has a format like 111122223333.
493504
* Account-based endpoint routing provides better request performance for some services.

src/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class AWS_CORE_API CurlHttpClient: public HttpClient
6565
unsigned m_proxyPort = 0;
6666
Aws::String m_nonProxyHosts;
6767
bool m_verifySSL = true;
68+
bool m_revokeBestEffort = false;
6869
Aws::String m_caPath;
6970
Aws::String m_caFile;
7071
Aws::String m_proxyCaPath;

src/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ CurlHttpClient::CurlHttpClient(const ClientConfiguration& clientConfig) :
608608
m_proxySSLCertPath(clientConfig.proxySSLCertPath), m_proxySSLCertType(clientConfig.proxySSLCertType),
609609
m_proxySSLKeyPath(clientConfig.proxySSLKeyPath), m_proxySSLKeyType(clientConfig.proxySSLKeyType),
610610
m_proxyKeyPasswd(clientConfig.proxySSLKeyPassword),
611-
m_proxyPort(clientConfig.proxyPort), m_verifySSL(clientConfig.verifySSL), m_caPath(clientConfig.caPath),
611+
m_proxyPort(clientConfig.proxyPort), m_verifySSL(clientConfig.verifySSL), m_revokeBestEffort(clientConfig.curlOptions.revokeBestEffort), m_caPath(clientConfig.caPath),
612612
m_caFile(clientConfig.caFile), m_proxyCaPath(clientConfig.proxyCaPath), m_proxyCaFile(clientConfig.proxyCaFile),
613613
m_disableExpectHeader(clientConfig.disableExpectHeader),
614614
m_enableHttpClientTrace(clientConfig.enableHttpClientTrace || FORCE_ENABLE_CURL_LOGGING),
@@ -744,6 +744,19 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<
744744
#else
745745
curl_easy_setopt(connectionHandle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
746746
#endif
747+
748+
#if LIBCURL_VERSION_NUM >= 0x074600 // 7.70.0
749+
if (m_revokeBestEffort)
750+
{
751+
curl_easy_setopt(connectionHandle, CURLOPT_SSL_OPTIONS, CURLSSLOPT_REVOKE_BEST_EFFORT);
752+
}
753+
#else
754+
if (m_revokeBestEffort)
755+
{
756+
AWS_LOGSTREAM_WARN(CURL_HTTP_CLIENT_TAG,
757+
"curlOptions.revokeBestEffort requires libcurl >= 7.70.0");
758+
}
759+
#endif
747760
}
748761
else
749762
{

0 commit comments

Comments
 (0)