summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_ssl_openssl.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-01-27 16:52:21 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-01-27 16:52:21 +0100
commit46aa62b2d3deaa0633cd93eb6946146329fd14f2 (patch)
treea3c52c3ce39240a9c286cd9b2e455a3b2824b77c /src/modules/extra/m_ssl_openssl.cpp
parent045747290ba1088daf7f70d5d36d0eb4c8ba2b4e (diff)
m_ssl_gnutls, m_ssl_openssl Extract code that builds a ciphersuite string into a method
Diffstat (limited to 'src/modules/extra/m_ssl_openssl.cpp')
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index b38478d6d..2b4562544 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -678,7 +678,9 @@ class OpenSSLIOHook : public SSLIOHook
{
if (sess)
{
- std::string text = "*** You are connected using SSL cipher '" + std::string(SSL_get_cipher(sess)) + "'";
+ std::string text = "*** You are connected using SSL cipher '";
+ GetCiphersuite(text);
+ text += '\'';
const std::string& fingerprint = certificate->fingerprint;
if (!fingerprint.empty())
text += " and your SSL certificate fingerprint is " + fingerprint;
@@ -686,6 +688,11 @@ class OpenSSLIOHook : public SSLIOHook
user->WriteNotice(text);
}
}
+
+ void GetCiphersuite(std::string& out) const
+ {
+ out.append(SSL_get_cipher(sess));
+ }
};
static void StaticSSLInfoCallback(const SSL* ssl, int where, int rc)