diff options
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 10 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 13 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 8c08fb80b..a6fd64fa7 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -80,6 +80,7 @@ class ModuleSSLGnuTLS : public Module std::string certfile; std::string cafile; std::string crlfile; + std::string sslports; int dh_bits; int clientactive; @@ -124,6 +125,7 @@ class ModuleSSLGnuTLS : public Module listenports.clear(); clientactive = 0; + sslports.clear(); for(int i = 0; i < Conf->Enumerate("bind"); i++) { @@ -147,6 +149,7 @@ class ModuleSSLGnuTLS : public Module if (ServerInstance->Config->ports[i]->GetPort() == portno) ServerInstance->Config->ports[i]->SetDescription("ssl"); ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno); + sslports.append("*:").append(ConvToStr(portno)).append(";"); } else { @@ -281,10 +284,15 @@ class ModuleSSLGnuTLS : public Module void Implements(char* List) { - List[I_OnRawSocketConnect] = List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = 1; + List[I_On005Numeric] = List[I_OnRawSocketConnect] = List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = 1; List[I_OnRequest] = List[I_OnSyncUserMetaData] = List[I_OnDecodeMetaData] = List[I_OnUnloadModule] = List[I_OnRehash] = List[I_OnWhois] = List[I_OnPostConnect] = 1; } + virtual void On005Numeric(std::string &output) + { + output.append(" SSL=" + sslports); + } + virtual char* OnRequest(Request* request) { ISHRequest* ISR = (ISHRequest*)request; diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 943d88843..1d323e3b8 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -122,6 +122,7 @@ class ModuleSSLOpenSSL : public Module std::string cafile; // std::string crlfile; std::string dhfile; + std::string sslports; int clientactive; @@ -168,6 +169,7 @@ class ModuleSSLOpenSSL : public Module listenports.clear(); clientactive = 0; + sslports.clear(); for (int i = 0; i < Conf->Enumerate("bind"); i++) { @@ -191,6 +193,7 @@ class ModuleSSLOpenSSL : public Module if (ServerInstance->Config->ports[i]->GetPort() == portno) ServerInstance->Config->ports[i]->SetDescription("ssl"); ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", portno); + sslports.append("*:").append(ConvToStr(portno)).append(";"); } else { @@ -205,6 +208,9 @@ class ModuleSSLOpenSSL : public Module } } + if (!sslports.empty()) + sslports.erase(sslports.end() - 1); + std::string confdir(ServerInstance->ConfigFileName); // +1 so we the path ends with a / confdir = confdir.substr(0, confdir.find_last_of('/') + 1); @@ -285,6 +291,11 @@ class ModuleSSLOpenSSL : public Module DELETE(Conf); } + virtual void On005Numeric(std::string &output) + { + output.append(" SSL=" + sslports); + } + virtual ~ModuleSSLOpenSSL() { SSL_CTX_free(ctx); @@ -334,7 +345,7 @@ class ModuleSSLOpenSSL : public Module void Implements(char* List) { - List[I_OnRawSocketConnect] = List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = 1; + List[I_OnRawSocketConnect] = List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = List[I_On005Numeric] = 1; List[I_OnRequest] = List[I_OnSyncUserMetaData] = List[I_OnDecodeMetaData] = List[I_OnUnloadModule] = List[I_OnRehash] = List[I_OnWhois] = List[I_OnPostConnect] = 1; } |