Merge pull request #87 from james-d-elliott/fix-tls-config

fix: tls config unused with dialer
This commit is contained in:
Winni Neessen 2022-12-26 16:47:15 +01:00 committed by GitHub
commit e7b162a295
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -431,9 +431,11 @@ func (c *Client) DialWithContext(pc context.Context) error {
defer cfn()
nd := net.Dialer{}
td := tls.Dialer{}
var err error
if c.ssl {
td := tls.Dialer{NetDialer: &nd, Config: c.tlsconfig}
c.enc = true
c.co, err = td.DialContext(ctx, "tcp", c.ServerAddr())
}