init empty TLSConfig, if nothing given
This commit is contained in:
parent
d36428fb2f
commit
e05f36c69f
|
@ -117,6 +117,10 @@ func (s *Session) startTlsIfSupported(conn net.Conn, domain string, o Config) ne
|
||||||
return conn
|
return conn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if o.TLSConfig == nil {
|
||||||
|
o.TLSConfig = &tls.Config{}
|
||||||
|
}
|
||||||
|
|
||||||
if o.TLSConfig.ServerName == "" {
|
if o.TLSConfig.ServerName == "" {
|
||||||
o.TLSConfig.ServerName = domain
|
o.TLSConfig.ServerName = domain
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue