From 76eb65c911fcf1fcff030bef4e19807cab227aae Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 31 Aug 2017 09:29:43 -0400 Subject: [PATCH] Fix crash in consul backend A TLS config was being assigned to a Transport in a nil http.Client. The Transport is built in the consul config by default, but the http.Client is not built until later in NewClient. --- backend/remote-state/consul/backend.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/remote-state/consul/backend.go b/backend/remote-state/consul/backend.go index e4170abb1..a6755872c 100644 --- a/backend/remote-state/consul/backend.go +++ b/backend/remote-state/consul/backend.go @@ -2,7 +2,6 @@ package consul import ( "context" - "net/http" "strings" consulapi "github.com/hashicorp/consul/api" @@ -149,7 +148,7 @@ func (b *Backend) clientRaw() (*consulapi.Client, error) { if err != nil { return nil, err } - config.HttpClient.Transport.(*http.Transport).TLSClientConfig = cc + config.Transport.TLSClientConfig = cc if v, ok := data.GetOk("http_auth"); ok && v.(string) != "" { auth := v.(string)