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: