Fix client no StartTLS & server no required

This commit is contained in:
rayshih 2019-01-24 15:48:01 +08:00
parent e543ad3fcd
commit 1f614e5b8d

View File

@ -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: