1
0
Fork 0
forked from External/ergo

allow WEBIRC to set the TLS flag over local plaintext connections

This commit is contained in:
Shivaram Lingamneni 2018-01-31 21:07:57 -05:00
parent 09a17b32be
commit b7f66fb1de
2 changed files with 16 additions and 3 deletions

View file

@ -58,9 +58,11 @@ func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
key = x
}
// only accept "tls" flag if the gateway's connection to us is secure as well
if strings.ToLower(key) == "tls" && client.flags[TLS] {
secure = true
if strings.ToLower(key) == "tls" {
// only accept "tls" flag if the gateway's connection to us is secure as well
if client.flags[TLS] || utils.AddrIsLocal(client.socket.conn.RemoteAddr()) {
secure = true
}
}
}
}