summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp7
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp3
2 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 6abc5c1de..def9abdd2 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -657,6 +657,13 @@ class ModuleSSLGnuTLS : public Module
DELETE(metadata);
VerifyCertificate(&sessions[user->GetFd()],user);
+ if (sessions[user->GetFd()].sess)
+ {
+ std::string cipher = gnutls_kx_get_name(gnutls_kx_get(sessions[user->GetFd()].sess));
+ cipher.append("-").append(gnutls_cipher_get_name(gnutls_cipher_get(sessions[user->GetFd()].sess))).append("-");
+ cipher.append(gnutls_mac_get_name(gnutls_mac_get(sessions[user->GetFd()].sess)));
+ user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick, cipher.c_str());
+ }
}
}
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index def8a0061..ee672b798 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -107,6 +107,7 @@ class ModuleSSLOpenSSL : public Module
SSL_CTX* clictx;
char* dummy;
+ char cipher[MAXBUF];
std::string keyfile;
std::string certfile;
@@ -746,6 +747,8 @@ class ModuleSSLOpenSSL : public Module
DELETE(metadata);
VerifyCertificate(&sessions[user->GetFd()], user);
+ if (sessions[user->GetFd()].sess)
+ user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick, SSL_get_cipher(sessions[user->GetFd()].sess));
}
}