Merge pull request #16861 from Jokser/disk-s3-proxy-tunnel-mode

Support HTTP proxy and HTTPS S3 endpoint configuration
This commit is contained in:
tavplubix 2020-11-30 16:05:12 +03:00 committed by GitHub
commit db3918d88d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,12 +172,16 @@ void PocoHTTPClient::makeRequestInternal(
auto request_configuration = per_request_configuration(request);
if (!request_configuration.proxyHost.empty())
{
/// Turn on tunnel mode if proxy scheme is HTTP while endpoint scheme is HTTPS.
bool use_tunnel = request_configuration.proxyScheme == Aws::Http::Scheme::HTTP && poco_uri.getScheme() == "https";
session->setProxy(
request_configuration.proxyHost,
request_configuration.proxyPort,
Aws::Http::SchemeMapper::ToString(request_configuration.proxyScheme),
false /// Disable proxy tunneling by default
use_tunnel
);
}
Poco::Net::HTTPRequest poco_request(Poco::Net::HTTPRequest::HTTP_1_1);