forked from jshiffer/go-xmpp
fix DefaultConfig.ServerName not set when func NewClient(host...) is used
This commit is contained in:
parent
08299587ec
commit
61f20ce1de
1
xmpp.go
1
xmpp.go
@ -168,6 +168,7 @@ func (o Options) NewClient() (*Client, error) {
|
|||||||
if o.TLSConfig != nil {
|
if o.TLSConfig != nil {
|
||||||
tlsconn = tls.Client(c, o.TLSConfig)
|
tlsconn = tls.Client(c, o.TLSConfig)
|
||||||
} else {
|
} else {
|
||||||
|
DefaultConfig.ServerName = strings.Split(o.User, "@")[1]
|
||||||
tlsconn = tls.Client(c, &DefaultConfig)
|
tlsconn = tls.Client(c, &DefaultConfig)
|
||||||
}
|
}
|
||||||
if err = tlsconn.Handshake(); err != nil {
|
if err = tlsconn.Handshake(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user