From 505ebe70247cf2f473539bd8606ef1cc4b32f4fb Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Mon, 20 Oct 2014 22:52:34 -0700 Subject: [PATCH] removed hard-coded `http` in Docker client --- shared/build/docker/client.go | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/shared/build/docker/client.go b/shared/build/docker/client.go index 919c933e5..ea5ef08eb 100644 --- a/shared/build/docker/client.go +++ b/shared/build/docker/client.go @@ -175,6 +175,9 @@ func (c *Client) do(method, path string, in, out interface{}) error { // dial the host server req.URL.Host = c.addr req.URL.Scheme = "http" + if c.tls != nil { + req.URL.Scheme = "https" + } resp, err := c.HTTPClient().Do(req) if err != nil { @@ -272,26 +275,12 @@ func (c *Client) stream(method, path string, in io.Reader, out io.Writer, header req.Header.Set("User-Agent", "Docker-Client/0.6.4") req.Header.Set("Content-Type", "plain/text") - // dial the host server - /* - req.Host = c.addr - dial, err := net.Dial(c.proto, c.addr) - if err != nil { - return err - } - - // make the request - conn := httputil.NewClientConn(dial, nil) - resp, err := conn.Do(req) - defer conn.Close() - if err != nil { - return err - } - */ - // dial the host server req.URL.Host = c.addr req.URL.Scheme = "http" + if c.tls != nil { + req.URL.Scheme = "https" + } resp, err := c.HTTPClient().Do(req) if err != nil {