Skip to content

Commit a915269

Browse files
committed
don't set _peerHostName from peerAddress
1 parent 9f694ee commit a915269

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

‎NetSSL_OpenSSL/src/SecureSocketImpl.cpp‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ SecureSocketImpl::~SecureSocketImpl()
6868
}
6969
}
7070

71-
71+
7272
SocketImpl* SecureSocketImpl::acceptConnection(SocketAddress& clientAddr)
7373
{
7474
poco_assert (!_pSSL);
@@ -104,7 +104,7 @@ void SecureSocketImpl::acceptSSL()
104104
void SecureSocketImpl::connect(const SocketAddress& address, bool performHandshake)
105105
{
106106
if (_pSSL) reset();
107-
107+
108108
poco_assert (!_pSSL);
109109

110110
_pSocket->connect(address);
@@ -115,7 +115,7 @@ void SecureSocketImpl::connect(const SocketAddress& address, bool performHandsha
115115
void SecureSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout, bool performHandshake)
116116
{
117117
if (_pSSL) reset();
118-
118+
119119
poco_assert (!_pSSL);
120120

121121
_pSocket->connect(address, timeout);
@@ -125,14 +125,14 @@ void SecureSocketImpl::connect(const SocketAddress& address, const Poco::Timespa
125125
_pSocket->setSendTimeout(timeout);
126126
connectSSL(performHandshake);
127127
_pSocket->setReceiveTimeout(receiveTimeout);
128-
_pSocket->setSendTimeout(sendTimeout);
128+
_pSocket->setSendTimeout(sendTimeout);
129129
}
130130

131131

132132
void SecureSocketImpl::connectNB(const SocketAddress& address)
133133
{
134134
if (_pSSL) reset();
135-
135+
136136
poco_assert (!_pSSL);
137137

138138
_pSocket->connectNB(address);
@@ -144,7 +144,7 @@ void SecureSocketImpl::connectSSL(bool performHandshake)
144144
{
145145
poco_assert (!_pSSL);
146146
poco_assert (_pSocket->initialized());
147-
147+
148148
BIO* pBIO = BIO_new(BIO_s_socket());
149149
if (!pBIO) throw SSLException("Cannot create SSL BIO object");
150150
BIO_set_fd(pBIO, static_cast<int>(_pSocket->sockfd()), BIO_NOCLOSE);
@@ -156,7 +156,7 @@ void SecureSocketImpl::connectSSL(bool performHandshake)
156156
throw SSLException("Cannot create SSL object");
157157
}
158158
SSL_set_bio(_pSSL, pBIO, pBIO);
159-
159+
160160
#if OPENSSL_VERSION_NUMBER >= 0x0908060L && !defined(OPENSSL_NO_TLSEXT)
161161
if (!_peerHostName.empty())
162162
{
@@ -168,7 +168,7 @@ void SecureSocketImpl::connectSSL(bool performHandshake)
168168
{
169169
SSL_set_session(_pSSL, _pSession->sslSession());
170170
}
171-
171+
172172
try
173173
{
174174
if (performHandshake && _pSocket->getBlocking())
@@ -199,7 +199,7 @@ void SecureSocketImpl::bind(const SocketAddress& address, bool reuseAddress)
199199
_pSocket->bind(address, reuseAddress);
200200
}
201201

202-
202+
203203
void SecureSocketImpl::listen(int backlog)
204204
{
205205
poco_check_ptr (_pSocket);
@@ -347,9 +347,9 @@ int SecureSocketImpl::completeHandshake()
347347
void SecureSocketImpl::verifyPeerCertificate()
348348
{
349349
if (_peerHostName.empty())
350-
_peerHostName = _pSocket->peerAddress().host().toString();
351-
352-
verifyPeerCertificate(_peerHostName);
350+
verifyPeerCertificate(_pSocket->peerAddress().host().toString());
351+
else
352+
verifyPeerCertificate(_peerHostName);
353353
}
354354

355355

@@ -546,7 +546,7 @@ Session::Ptr SecureSocketImpl::currentSession()
546546
return 0;
547547
}
548548

549-
549+
550550
void SecureSocketImpl::useSession(Session::Ptr pSession)
551551
{
552552
_pSession = pSession;

0 commit comments

Comments
 (0)