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 {