Bugfix: Do not reopen stream if starttls was not enabled.

This commit is contained in:
Mickael Remond 2016-01-06 17:19:16 +01:00
parent ff334ba729
commit 1b90d5d2ef

View File

@ -38,7 +38,9 @@ func NewSession(conn net.Conn, o Options) (net.Conn, *Session, error) {
// starttls
var tlsConn net.Conn
tlsConn = s.startTlsIfSupported(conn, o.parsedJid.domain)
if s.TlsEnabled {
s.reset(conn, tlsConn, o)
}
// auth
s.auth(o)