diff --git a/registry/consul/consul.go b/registry/consul/consul.go index 7e9cf794..52b8b2cd 100644 --- a/registry/consul/consul.go +++ b/registry/consul/consul.go @@ -105,12 +105,13 @@ func configure(c *consulRegistry, opts ...registry.Option) { } } + if config.HttpClient == nil { + config.HttpClient = new(http.Client) + } + // requires secure connection? if c.opts.Secure || c.opts.TLSConfig != nil { - if config.HttpClient == nil { - config.HttpClient = new(http.Client) - } - + config.Scheme = "https" // We're going to support InsecureSkipVerify config.HttpClient.Transport = newTransport(c.opts.TLSConfig)