From 0b30bacb41aa1491a2eebacb04976d38b8d52022 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Sun, 3 Jul 2016 12:48:15 +0200 Subject: [PATCH] fixed GH #1303: HTTPSClientSession::sendRequest() fails if server has wildcard cert --- NetSSL_OpenSSL/src/HTTPSClientSession.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/NetSSL_OpenSSL/src/HTTPSClientSession.cpp b/NetSSL_OpenSSL/src/HTTPSClientSession.cpp index d338981d1..567e256bf 100644 --- a/NetSSL_OpenSSL/src/HTTPSClientSession.cpp +++ b/NetSSL_OpenSSL/src/HTTPSClientSession.cpp @@ -64,8 +64,6 @@ HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 por { setHost(host); setPort(port); - SecureStreamSocket sss(socket()); - sss.setPeerHostName(host); } @@ -90,8 +88,6 @@ HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 por { setHost(host); setPort(port); - SecureStreamSocket sss(socket()); - sss.setPeerHostName(host); } @@ -102,8 +98,6 @@ HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 por { setHost(host); setPort(port); - SecureStreamSocket sss(socket()); - sss.setPeerHostName(host); } @@ -148,6 +142,10 @@ void HTTPSClientSession::connect(const SocketAddress& address) if (getProxyHost().empty() || bypassProxy()) { SecureStreamSocket sss(socket()); + if (sss.getPeerHostName().empty()) + { + sss.setPeerHostName(getHost()); + } if (_pContext->sessionCacheEnabled()) { sss.useSession(_pSession);