From 7c08ce749f98a84d7176c81af2cf08cda11effde Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 29 Oct 2013 23:03:21 -0400 Subject: [PATCH] Certificates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Stores the host name in the session, for handѕhake validation. --- src/TLSClient.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TLSClient.cpp b/src/TLSClient.cpp index 0ee60c201..b40756e32 100644 --- a/src/TLSClient.cpp +++ b/src/TLSClient.cpp @@ -182,6 +182,10 @@ void TLSClient::init ( //////////////////////////////////////////////////////////////////////////////// void TLSClient::connect (const std::string& host, const std::string& port) { + // Store the host name, so the verification callback can access it during the + // handshake below. + gnutls_session_set_ptr (_session, (void*) host.c_str ()); + // use IPv4 or IPv6, does not matter. struct addrinfo hints = {0}; hints.ai_family = AF_UNSPEC;