diff options
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 27 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 31 |
2 files changed, 33 insertions, 25 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 01e700885..07e11aaa7 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -183,21 +183,26 @@ class ModuleSSLGnuTLS : public Module { sslports.clear(); - for (size_t i = 0; i < ServerInstance->ports.size(); i++) + ConfigTag* Conf = ServerInstance->Config->ConfValue("gnutls"); + + if (Conf->getBool("showports", true)) { - ListenSocket* port = ServerInstance->ports[i]; - if (port->bind_tag->getString("ssl") != "gnutls") - continue; + for (size_t i = 0; i < ServerInstance->ports.size(); i++) + { + ListenSocket* port = ServerInstance->ports[i]; + if (port->bind_tag->getString("ssl") != "gnutls") + continue; - const std::string& portid = port->bind_desc; - ServerInstance->Logs->Log("m_ssl_gnutls", DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %s", portid.c_str()); + const std::string& portid = port->bind_desc; + ServerInstance->Logs->Log("m_ssl_gnutls", DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %s", portid.c_str()); - if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") - sslports.append(portid).append(";"); - } + if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") + sslports.append(portid).append(";"); + } - if (!sslports.empty()) - sslports.erase(sslports.end() - 1); + if (!sslports.empty()) + sslports.erase(sslports.end() - 1); + } } void OnModuleRehash(User* user, const std::string ¶m) diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index e099facd3..a0302fa9c 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -137,24 +137,27 @@ class ModuleSSLOpenSSL : public Module void OnRehash(User* user) { - ConfigReader Conf; - sslports.clear(); - for (size_t i = 0; i < ServerInstance->ports.size(); i++) + ConfigTag* Conf = ServerInstance->Config->ConfValue("openssl"); + + if (Conf->getBool("showports", true)) { - ListenSocket* port = ServerInstance->ports[i]; - if (port->bind_tag->getString("ssl") != "openssl") - continue; - - std::string portid = port->bind_desc; - ServerInstance->Logs->Log("m_ssl_openssl", DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %s", portid.c_str()); - if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") - sslports.append(portid).append(";"); - } + for (size_t i = 0; i < ServerInstance->ports.size(); i++) + { + ListenSocket* port = ServerInstance->ports[i]; + if (port->bind_tag->getString("ssl") != "openssl") + continue; + + std::string portid = port->bind_desc; + ServerInstance->Logs->Log("m_ssl_openssl", DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %s", portid.c_str()); + if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") + sslports.append(portid).append(";"); + } - if (!sslports.empty()) - sslports.erase(sslports.end() - 1); + if (!sslports.empty()) + sslports.erase(sslports.end() - 1); + } } void OnModuleRehash(User* user, const std::string ¶m) |