mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Enable DNS cache for HTTPSClientSession.
This commit is contained in:
parent
1d711496c3
commit
77fb1b84ac
2
contrib/poco
vendored
2
contrib/poco
vendored
@ -1 +1 @@
|
||||
Subproject commit 6c1a233744d13414e8e8db396c75177b857b2c22
|
||||
Subproject commit 5d11f0aa6fd2faad0a7b34aa355cd50c4deb27e6
|
@ -75,7 +75,13 @@ namespace
|
||||
{
|
||||
#if USE_SSL
|
||||
/// Cannot resolve host in advance, otherwise SNI won't work in Poco.
|
||||
session = std::make_shared<Poco::Net::HTTPSClientSession>(host, port);
|
||||
|
||||
String resolved_host = resolve_host ? DNSResolver::instance().resolveHost(host).toString() : host;
|
||||
auto https_session = std::make_shared<Poco::Net::HTTPSClientSession>(host, port);
|
||||
if (resolve_host)
|
||||
https_session->setResolvedHost(DNSResolver::instance().resolveHost(host).toString());
|
||||
|
||||
session = std::move(https_session);
|
||||
#else
|
||||
throw Exception("ClickHouse was built without HTTPS support", ErrorCodes::FEATURE_IS_NOT_ENABLED_AT_BUILD_TIME);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user