3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-29 23:49:25 +01:00

review feedback

This commit is contained in:
Shivaram Lingamneni 2019-07-12 09:58:14 -04:00
parent 3fa1c526a6
commit 86ad402203

View File

@ -884,9 +884,13 @@ func (server *Server) setupListeners(config *Config) (err error) {
// create new listeners that were not previously configured // create new listeners that were not previously configured
numTlsListeners := 0 numTlsListeners := 0
hasStandardTlsListener := false
for newAddr, newConfig := range config.Server.trueListeners { for newAddr, newConfig := range config.Server.trueListeners {
if newConfig.TLSConfig != nil { if newConfig.TLSConfig != nil {
numTlsListeners += 1 numTlsListeners += 1
if strings.HasSuffix(newAddr, ":6697") {
hasStandardTlsListener = true
}
} }
_, exists := server.listeners[newAddr] _, exists := server.listeners[newAddr]
if !exists { if !exists {
@ -906,7 +910,7 @@ func (server *Server) setupListeners(config *Config) (err error) {
server.logger.Warning("server", "You are not exposing an SSL/TLS listening port. You should expose at least one port (typically 6697) to accept TLS connections") server.logger.Warning("server", "You are not exposing an SSL/TLS listening port. You should expose at least one port (typically 6697) to accept TLS connections")
} }
if config.Server.trueListeners[":6697"].TLSConfig == nil { if !hasStandardTlsListener {
server.logger.Warning("server", "Port 6697 is the standard TLS port for IRC. You should (also) expose port 6697 as a TLS port to ensure clients can connect securely") server.logger.Warning("server", "Port 6697 is the standard TLS port for IRC. You should (also) expose port 6697 as a TLS port to ensure clients can connect securely")
} }