TlsStream::~TlsStream(void)
{
- Close();
+ CloseInternal(true);
}
int TlsStream::ValidateCertificate(int preverify_ok, X509_STORE_CTX *ctx)
*/
void TlsStream::Close(void)
{
-<<<<<<< HEAD
- if (!m_Eof) {
- m_Eof = true;
-=======
CloseInternal(false);
}
m_Eof = true;
if (!inDestructor)
->>>>>>> 2dc385e... Fix memory/thread leak in the HttpServerConnection class
SignalDataAvailable();
- Stream::Close();
-
SocketEvents::Unregister();
- boost::mutex::scoped_lock lock(m_Mutex);
+ Stream::Close();
+ boost::mutex::scoped_lock lock(m_Mutex);
if (!m_SSL)
return;
static int ValidateCertificate(int preverify_ok, X509_STORE_CTX *ctx);
static void NullCertificateDeleter(X509 *certificate);
+
+ void CloseInternal(bool inDestructor);
};
}
return;
}
+ if (!hostname.IsEmpty() && identity != hostname) {
+ Log(LogInformation, "ApiListener")
+ << "Unexpected certificate common name while connecting to endpoint '" << hostname << "': got '" << identity << "'";
+ return;
+ }
+
verify_ok = tlsStream->IsVerifyOK();
Log(LogInformation, "ApiListener")