From ace4f3d892c0d11d93d4831e00cd0705c4d3c7b0 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Fri, 19 Oct 2018 16:08:20 +0200 Subject: [PATCH] transport/tlsclientauth: handle cancellation of dialCtx --- daemon/transport/connecter/connect_tls.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/transport/connecter/connect_tls.go b/daemon/transport/connecter/connect_tls.go index 28f3440..a60cb45 100644 --- a/daemon/transport/connecter/connect_tls.go +++ b/daemon/transport/connecter/connect_tls.go @@ -39,5 +39,9 @@ func TLSConnecterFromConfig(in *config.TLSConnect) (*TLSConnecter, error) { } func (c *TLSConnecter) Connect(dialCtx context.Context) (conn net.Conn, err error) { - return tls.DialWithDialer(&c.dialer, "tcp", c.Address, c.tlsConfig) + conn, err = c.dialer.DialContext(dialCtx, "tcp", c.Address) + if err != nil { + return nil, err + } + return tls.Client(conn, c.tlsConfig), nil }