diff --git a/xmpp.go b/xmpp.go index 129eb40..4cbe9bf 100644 --- a/xmpp.go +++ b/xmpp.go @@ -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 {