Merge pull request #196 from sarbash/fix-tls-consul-registry

Fixes nil pointer dereferencing for Consul TLS transport
This commit is contained in:
Asim Aslam 2017-08-15 08:08:03 +01:00 committed by GitHub
commit 87c39542b0

View File

@ -81,6 +81,9 @@ func newConsulRegistry(opts ...Option) Registry {
if options.Secure || options.TLSConfig != nil { if options.Secure || options.TLSConfig != nil {
config.Scheme = "https" config.Scheme = "https"
// We're going to support InsecureSkipVerify // We're going to support InsecureSkipVerify
if config.HttpClient == nil {
config.HttpClient = new(http.Client)
}
config.HttpClient.Transport = newTransport(options.TLSConfig) config.HttpClient.Transport = newTransport(options.TLSConfig)
} }