From 1397ff81c1fbb17cb00c1e32f0f6b8e214f93edb Mon Sep 17 00:00:00 2001 From: Russ Garrett Date: Thu, 25 Nov 2021 13:44:44 +0000 Subject: [PATCH] Fix TLS server name validation --- irc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/irc.go b/irc.go index c261a80..bb67b34 100644 --- a/irc.go +++ b/irc.go @@ -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 }