Fixes nil pointer dereferencing for Consul TLS transport

This commit is contained in:
Sergey Sarbash 2017-08-15 09:27:39 +03:00
parent 382abbf28b
commit fd01ead575

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)
} }