use ServerName to verify tls hostname (#127)

This commit is contained in:
marzzzello
2021-01-21 09:27:23 +01:00
committed by GitHub
parent 42ee290fc5
commit b40e129499

View File

@@ -241,6 +241,7 @@ func (o Options) NewClient() (*Client, error) {
var tlsconn *tls.Conn
if o.TLSConfig != nil {
tlsconn = tls.Client(c, o.TLSConfig)
host = o.TLSConfig.ServerName
} else {
newconfig := DefaultConfig.Clone()
newconfig.ServerName = host