fixed GH #1303: HTTPSClientSession::sendRequest() fails if server has wildcard cert

This commit is contained in:
Guenter Obiltschnig 2016-07-03 12:48:15 +02:00
parent f848106fca
commit 0b30bacb41

View File

@ -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);