diff options
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 23 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 23 |
2 files changed, 30 insertions, 16 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index b88cf0c03..11b5bf97b 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -131,17 +131,24 @@ class ModuleSSLGnuTLS : public Module long portno = -1; while ((portno = portrange.GetToken())) { - if (ServerInstance->Config->AddIOHook(portno, this)) + try { - listenports.push_back(portno); - for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++) - if (ServerInstance->Config->ports[i] == portno) - ServerInstance->Config->openSockfd[i]->SetDescription("ssl"); - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno); + if (ServerInstance->Config->AddIOHook(portno, this)) + { + listenports.push_back(portno); + for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++) + if (ServerInstance->Config->ports[i] == portno) + ServerInstance->Config->openSockfd[i]->SetDescription("ssl"); + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno); + } + else + { + ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", portno); + } } - else + catch (ModuleException &e) { - ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", portno); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have an other SSL or similar module loaded?", portno, e.GetReason()); } } } diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 6bd75b824..5e6166fa4 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -168,17 +168,24 @@ class ModuleSSLOpenSSL : public Module long portno = -1; while ((portno = portrange.GetToken())) { - if (ServerInstance->Config->AddIOHook(portno, this)) + try { - listenports.push_back(portno); - for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++) - if (ServerInstance->Config->ports[i] == portno) - ServerInstance->Config->openSockfd[i]->SetDescription("ssl"); - ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", portno); + if (ServerInstance->Config->AddIOHook(portno, this)) + { + listenports.push_back(portno); + for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++) + if (ServerInstance->Config->ports[i] == portno) + ServerInstance->Config->openSockfd[i]->SetDescription("ssl"); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", portno); + } + else + { + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", portno); + } } - else + catch (ModuleException &e) { - ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", portno); + ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d: %s. Maybe it's already hooked by the same port on a different IP, or you have another SSL or similar module loaded?", portno, e.GetReason()); } } } |