Merge pull request #110 from eaglerayp/feature/noTLS

Fix client no StartTLS & server no required
This commit is contained in:
mattn 2019-01-24 18:32:44 +09:00 committed by GitHub
commit 6093f50721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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: