mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-23 20:33:46 -07:00
use ServerName to verify tls hostname (#127)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user