diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-04-30 16:54:37 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-04-30 16:54:37 +0200 |
commit | fb66fb5ce3410d7e32813aed85e8ad3050584740 (patch) | |
tree | a36d649156325dbd76f314eaac6c14f724d56b04 /src/modules/m_sslinfo.cpp | |
parent | 6cfe4011ec0e90718d7d5a449a5330b8e9a18ec3 (diff) | |
parent | 1e4b53a286e428e78bd5650815048970d345f7e3 (diff) |
Merge branch 'master+sslconnmsg'
Diffstat (limited to 'src/modules/m_sslinfo.cpp')
-rw-r--r-- | src/modules/m_sslinfo.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 6a29d3bde..9682e92cf 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -209,8 +209,26 @@ class ModuleSSLInfo : public Module, public Whois::EventListener void OnPostConnect(User* user) CXX11_OVERRIDE { - ssl_cert *cert = cmd.CertExt.get(user); - if (!cert || cert->fingerprint.empty()) + LocalUser* const localuser = IS_LOCAL(user); + if (!localuser) + return; + + const SSLIOHook* const ssliohook = SSLIOHook::IsSSL(&localuser->eh); + if (!ssliohook) + return; + + ssl_cert* const cert = ssliohook->GetCertificate(); + + { + std::string text = "*** You are connected using SSL cipher '"; + ssliohook->GetCiphersuite(text); + text.push_back('\''); + if ((cert) && (!cert->GetFingerprint().empty())) + text.append(" and your SSL certificate fingerprint is ").append(cert->GetFingerprint()); + user->WriteNotice(text); + } + + if (!cert) return; // find an auto-oper block for this user for (ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); ++i) |