mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-21 01:52:01 -08:00
Fix XMPP TLS config
This commit is contained in:
parent
87ff01ac68
commit
d0f2b492ac
@ -35,11 +35,13 @@ func (t XMPPTransport) IsSecure() bool {
|
||||
|
||||
func (t *XMPPTransport) StartTLS(domain string) error {
|
||||
if t.Config.TLSConfig == nil {
|
||||
t.Config.TLSConfig = &tls.Config{}
|
||||
t.TLSConfig = &tls.Config{}
|
||||
} else {
|
||||
t.TLSConfig = t.Config.TLSConfig.Clone()
|
||||
}
|
||||
|
||||
if t.Config.TLSConfig.ServerName == "" {
|
||||
t.Config.TLSConfig.ServerName = domain
|
||||
if t.TLSConfig.ServerName == "" {
|
||||
t.TLSConfig.ServerName = domain
|
||||
}
|
||||
tlsConn := tls.Client(t.conn, t.TLSConfig)
|
||||
// We convert existing connection to TLS
|
||||
|
Loading…
Reference in New Issue
Block a user