fix DefaultConfig.ServerName not set when func NewClient(host...) is used

This commit is contained in:
Teoman Soygul 2014-11-09 14:51:33 +01:00
parent 08299587ec
commit 61f20ce1de

View File

@ -168,6 +168,7 @@ func (o Options) NewClient() (*Client, error) {
if o.TLSConfig != nil {
tlsconn = tls.Client(c, o.TLSConfig)
} else {
DefaultConfig.ServerName = strings.Split(o.User, "@")[1]
tlsconn = tls.Client(c, &DefaultConfig)
}
if err = tlsconn.Handshake(); err != nil {