diff --git a/client.go b/client.go index e988d54..98b44fe 100644 --- a/client.go +++ b/client.go @@ -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()) }