From f12a237747f79421627948ee3be3e9117000a354 Mon Sep 17 00:00:00 2001 From: Minkyu Kim Date: Thu, 31 Aug 2017 16:58:44 +0900 Subject: [PATCH] Fix crash when using consul backend --- backend/remote-state/consul/backend.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/backend/remote-state/consul/backend.go b/backend/remote-state/consul/backend.go index a6755872c..ce7c2ee1f 100644 --- a/backend/remote-state/consul/backend.go +++ b/backend/remote-state/consul/backend.go @@ -134,21 +134,15 @@ func (b *Backend) clientRaw() (*consulapi.Client, error) { config.Datacenter = v.(string) } - tlsConfig := &consulapi.TLSConfig{} if v, ok := data.GetOk("ca_file"); ok && v.(string) != "" { - tlsConfig.CAFile = v.(string) + config.TLSConfig.CAFile = v.(string) } if v, ok := data.GetOk("cert_file"); ok && v.(string) != "" { - tlsConfig.CertFile = v.(string) + config.TLSConfig.CertFile = v.(string) } if v, ok := data.GetOk("key_file"); ok && v.(string) != "" { - tlsConfig.KeyFile = v.(string) + config.TLSConfig.KeyFile = v.(string) } - cc, err := consulapi.SetupTLSConfig(tlsConfig) - if err != nil { - return nil, err - } - config.Transport.TLSClientConfig = cc if v, ok := data.GetOk("http_auth"); ok && v.(string) != "" { auth := v.(string)