From 1f614e5b8d8650d28ac92c22b1bf1bc8991f46aa Mon Sep 17 00:00:00 2001 From: rayshih Date: Thu, 24 Jan 2019 15:48:01 +0800 Subject: [PATCH] Fix client no StartTLS & server no required --- xmpp.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmpp.go b/xmpp.go index 078270f..1c2570d 100644 --- a/xmpp.go +++ b/xmpp.go @@ -487,6 +487,8 @@ func (c *Client) startTLSIfRequired(f *streamFeatures, o *Options, domain string case f.StartTLS == nil: // the server does not support STARTTLS return f, nil + case !o.StartTLS && f.StartTLS.Required == nil: + return f, nil case f.StartTLS.Required != nil: // the server requires STARTTLS. case !o.StartTLS: