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.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index b67498072..9ad742416 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -193,7 +193,18 @@ class ModuleSSLInfo : public Module
ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass)
{
- if (myclass->config->getBool("requiressl") && !cmd.CertExt.get(user))
+ ssl_cert* cert = cmd.CertExt.get(user);
+ bool ok = true;
+ if (myclass->config->getBool("requiressl"))
+ {
+ ok = (cert != NULL);
+ }
+ else if (myclass->config->getString("requiressl") == "trusted")
+ {
+ ok = (cert && cert->IsCAVerified());
+ }
+
+ if (!ok)
return MOD_RES_DENY;
return MOD_RES_PASSTHRU;
}