Update Connection.cpp

This commit is contained in:
filimonov 2020-11-12 22:07:19 +01:00 committed by GitHub
parent 8eff47420b
commit 178d8e9b75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,8 @@ void Connection::connect(const ConnectionTimeouts & timeouts)
{
#if USE_SSL
socket = std::make_unique<Poco::Net::SecureStreamSocket>();
socket->setPeerHostName(host);
auto secure_socket = static_cast<Poco::Net::SecureStreamSocket*>(socket.get());
secure_socket->setPeerHostName(host);
#else
throw Exception{"tcp_secure protocol is disabled because poco library was built without NetSSL support.", ErrorCodes::SUPPORT_IS_DISABLED};
#endif