Replace readWriter and decoder after StartTLS

This commit is contained in:
Wichert Akkerman 2019-10-21 11:02:23 +02:00 committed by Mickaël Rémond
parent 60e2cdd088
commit 390f9b065e

View File

@ -78,6 +78,11 @@ func (t *XMPPTransport) StartTLS() error {
return err return err
} }
t.conn = tlsConn
t.readWriter = newStreamLogger(tlsConn, t.logFile)
t.decoder = xml.NewDecoder(t.readWriter)
t.decoder.CharsetReader = t.Config.CharsetReader
if !t.TLSConfig.InsecureSkipVerify { if !t.TLSConfig.InsecureSkipVerify {
if err := tlsConn.VerifyHostname(t.Config.Domain); err != nil { if err := tlsConn.VerifyHostname(t.Config.Domain); err != nil {
return err return err