summaryrefslogtreecommitdiff
path: root/src/modules/m_sslinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_sslinfo.cpp')
-rw-r--r--src/modules/m_sslinfo.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index e69f878d1..b67498072 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -127,8 +127,8 @@ class ModuleSSLInfo : public Module
ServerInstance->Extensions.Register(&cmd.CertExt);
- Implementation eventlist[] = { I_OnWhois, I_OnPreCommand };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ Implementation eventlist[] = { I_OnWhois, I_OnPreCommand, I_OnSetConnectClass };
+ ServerInstance->Modules->Attach(eventlist, this, 3);
}
Version GetVersion()
@@ -191,6 +191,13 @@ class ModuleSSLInfo : public Module
return MOD_RES_PASSTHRU;
}
+ ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass)
+ {
+ if (myclass->config->getBool("requiressl") && !cmd.CertExt.get(user))
+ return MOD_RES_DENY;
+ return MOD_RES_PASSTHRU;
+ }
+
void OnRequest(Request& request)
{
if (strcmp("GET_USER_CERT", request.id) == 0)