diff options
author | Peter Powell <petpow@saberuk.com> | 2017-10-29 11:15:47 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-10-29 11:15:47 +0000 |
commit | b047c903da20862783b50af73594cce1592cbbfe (patch) | |
tree | 145ed0054d272153295b5757e5722195ba3f3ca6 /src/modules/extra/m_ssl_openssl.cpp | |
parent | d865b434865907bfad0a187dd403d4ca8144e469 (diff) |
Add support to IOHook for retrieving the hostname sent via SNI.
Diffstat (limited to 'src/modules/extra/m_ssl_openssl.cpp')
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 4c246d6f5..45a728106 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -779,6 +779,16 @@ class OpenSSLIOHook : public SSLIOHook out.append(SSL_get_cipher(sess)); } + bool GetServerName(std::string& out) const CXX11_OVERRIDE + { + const char* name = SSL_get_servername(sess, TLSEXT_NAMETYPE_host_name); + if (!name) + return false; + + out.append(name); + return true; + } + bool IsHandshakeDone() const { return (status == ISSL_OPEN); } }; |