- // For each <bind> tag
- std::string x = Conf.ReadValue("bind", "type", index);
- if(((x.empty()) || (x == "clients")) && (Conf.ReadValue("bind", "ssl", index) == "openssl"))
- {
- // Get the port we're meant to be listening on with SSL
- std::string port = Conf.ReadValue("bind", "port", index);
- std::string addr = Conf.ReadValue("bind", "address", index);
-
- if (!addr.empty())
- {
- // normalize address, important for IPv6
- int portint = 0;
- irc::sockets::sockaddrs bin;
- if (irc::sockets::aptosa(addr.c_str(), portint, &bin))
- irc::sockets::satoap(&bin, addr, portint);
- }
-
- irc::portparser portrange(port, false);
- long portno = -1;
- while ((portno = portrange.GetToken()))
- {
- clientactive++;
- try
- {
- listenports.push_back(addr + ":" + ConvToStr(portno));
-
- for (size_t i = 0; i < ServerInstance->ports.size(); i++)
- if ((ServerInstance->ports[i]->GetPort() == portno) && (ServerInstance->ports[i]->GetIP() == addr))
- ServerInstance->ports[i]->SetDescription("ssl");
- ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %ld", portno);
-
- if (addr != "127.0.0.1")
- sslports.append((addr.empty() ? "*" : addr)).append(":").append(ConvToStr(portno)).append(";");
- }
- catch (ModuleException &e)
- {
- ServerInstance->Logs->Log("m_ssl_openssl",DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %ld: %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());
- }
- }
- }