Skip to content

Commit

Permalink
Fix TLS server name validation
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed Nov 25, 2021
1 parent 577848e commit 1397ff8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions irc.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ func (i *IRCCat) connectIRC(debug bool) error {

if viper.GetBool("irc.tls_skip_verify") {
irccon.TLSConfig = &tls.Config{InsecureSkipVerify: true}
} else {
server_parts := strings.Split(viper.GetString("irc.server"), ":")
irccon.TLSConfig = &tls.Config{ServerName: server_parts[0]}
}

if err := addClientCert(irccon); err != nil {
return err
}
Expand Down

0 comments on commit 1397ff8

Please sign in to comment.