From 33be90d6458ea41970bea2f653dd4d13b99bc4ec Mon Sep 17 00:00:00 2001 From: Pavel Kovalenko Date: Wed, 6 May 2020 14:52:50 +0300 Subject: [PATCH 1/2] Possibility to set HTTPS proxy scheme per request. --- .../include/aws/core/client/ClientConfiguration.h | 4 ++++ aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h b/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h index 23b5368a41ee..93290c5deeac 100644 --- a/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h +++ b/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h @@ -51,6 +51,10 @@ namespace Aws { ClientConfigurationPerRequest() : proxyPort(0) {} + /** + * If you have users going through a proxy, set the proxy scheme here. Default HTTP + */ + Aws::Http::Scheme proxyScheme; /** * If you have users going through a proxy, set the host here. */ diff --git a/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp b/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp index 7eec0fb05e1c..53075526cc9d 100644 --- a/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp +++ b/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp @@ -575,7 +575,8 @@ void CurlHttpClient::MakeRequestInternal(HttpRequest& request, if (usingProxy) { Aws::StringStream ss; - ss << m_proxyScheme << "://" << try_redefine(m_proxyHost, requestConfiguration.proxyHost); + ss << try_redefine(m_proxyScheme, Aws::String(SchemeMapper::ToString(requestConfiguration.proxyScheme))) + << "://" << try_redefine(m_proxyHost, requestConfiguration.proxyHost); curl_easy_setopt(connectionHandle, CURLOPT_PROXY, ss.str().c_str()); curl_easy_setopt(connectionHandle, CURLOPT_PROXYPORT, (long) try_redefine(m_proxyPort, requestConfiguration.proxyPort, 0U)); if (!m_proxyUserName.empty() || !m_proxyPassword.empty()) From fcb590961aa0602b28b14a1d54d890de2bbb4264 Mon Sep 17 00:00:00 2001 From: Pavel Kovalenko Date: Wed, 6 May 2020 15:32:29 +0300 Subject: [PATCH 2/2] Set default scheme to ClientConfigurationPerRequest. --- aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h b/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h index 93290c5deeac..e16838d62802 100644 --- a/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h +++ b/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h @@ -49,7 +49,7 @@ namespace Aws */ struct AWS_CORE_API ClientConfigurationPerRequest { - ClientConfigurationPerRequest() : proxyPort(0) {} + ClientConfigurationPerRequest() : proxyScheme(Aws::Http::Scheme::HTTPS), proxyPort(0) {} /** * If you have users going through a proxy, set the proxy scheme here. Default HTTP