From b5d891b109e0b1e94fdf86d924361177a33c9651 Mon Sep 17 00:00:00 2001 From: Jason Felice Date: Fri, 3 Feb 2017 11:07:03 -0500 Subject: [PATCH] Check result of config.ConfigureTLS() --- builtin/providers/vault/provider.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/providers/vault/provider.go b/builtin/providers/vault/provider.go index 24e10f4dc..cb8ab3e13 100644 --- a/builtin/providers/vault/provider.go +++ b/builtin/providers/vault/provider.go @@ -107,7 +107,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { clientAuthKey = clientAuth["key_file"].(string) } - config.ConfigureTLS(&api.TLSConfig{ + err := config.ConfigureTLS(&api.TLSConfig{ CACert: d.Get("ca_cert_file").(string), CAPath: d.Get("ca_cert_dir").(string), Insecure: d.Get("skip_tls_verify").(bool), @@ -115,6 +115,9 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { ClientCert: clientAuthCert, ClientKey: clientAuthKey, }) + if err != nil { + return nil, fmt.Errorf("failed to configure TLS for Vault API: %s", err) + } client, err := api.NewClient(config) if err != nil {