From 61f20ce1dec6d65514bed0369fa275048925bad2 Mon Sep 17 00:00:00 2001 From: Teoman Soygul Date: Sun, 9 Nov 2014 14:51:33 +0100 Subject: [PATCH] fix DefaultConfig.ServerName not set when func NewClient(host...) is used --- xmpp.go | 1 + 1 file changed, 1 insertion(+) 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 {