From 47f887ce435c0c6559cf5aea34dd3697d0e2c015 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 3 Dec 2015 21:10:45 -0500 Subject: [PATCH] Add SNI client support Close #1200 --- include/znc/Socket.h | 1 + src/Socket.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/znc/Socket.h b/include/znc/Socket.h index ea87a696..d1293f91 100644 --- a/include/znc/Socket.h +++ b/include/znc/Socket.h @@ -33,6 +33,7 @@ public: #ifdef HAVE_LIBSSL int VerifyPeerCertificate(int iPreVerify, X509_STORE_CTX * pStoreCTX) override; void SSLHandShakeFinished() override; + bool SNIConfigureClient(CString& sHostname) override; #endif void SetHostToVerifySSL(const CString& sHost) { m_HostToVerifySSL = sHost; } CString GetSSLPeerFingerprint() const; diff --git a/src/Socket.cpp b/src/Socket.cpp index 80e86675..b76d827b 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -126,6 +126,11 @@ void CZNCSock::SSLHandShakeFinished() { CallSockError(errnoBadSSLCert, sErrorMsg); Close(); } + +bool CZNCSock::SNIConfigureClient(CString& sHostname) { + sHostname = m_HostToVerifySSL; + return true; +} #endif CString CZNCSock::GetSSLPeerFingerprint() const {