forked from jshiffer/go-xmpp
use ServerName to verify tls hostname (#127)
This commit is contained in:
parent
42ee290fc5
commit
b40e129499
1
xmpp.go
1
xmpp.go
@ -241,6 +241,7 @@ func (o Options) NewClient() (*Client, error) {
|
|||||||
var tlsconn *tls.Conn
|
var tlsconn *tls.Conn
|
||||||
if o.TLSConfig != nil {
|
if o.TLSConfig != nil {
|
||||||
tlsconn = tls.Client(c, o.TLSConfig)
|
tlsconn = tls.Client(c, o.TLSConfig)
|
||||||
|
host = o.TLSConfig.ServerName
|
||||||
} else {
|
} else {
|
||||||
newconfig := DefaultConfig.Clone()
|
newconfig := DefaultConfig.Clone()
|
||||||
newconfig.ServerName = host
|
newconfig.ServerName = host
|
||||||
|
Loading…
Reference in New Issue
Block a user