Check result of config.ConfigureTLS()

This commit is contained in:
Jason Felice 2017-02-03 11:07:03 -05:00
parent 7da8e9285e
commit b5d891b109
1 changed files with 4 additions and 1 deletions

View File

@ -107,7 +107,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
clientAuthKey = clientAuth["key_file"].(string) clientAuthKey = clientAuth["key_file"].(string)
} }
config.ConfigureTLS(&api.TLSConfig{ err := config.ConfigureTLS(&api.TLSConfig{
CACert: d.Get("ca_cert_file").(string), CACert: d.Get("ca_cert_file").(string),
CAPath: d.Get("ca_cert_dir").(string), CAPath: d.Get("ca_cert_dir").(string),
Insecure: d.Get("skip_tls_verify").(bool), Insecure: d.Get("skip_tls_verify").(bool),
@ -115,6 +115,9 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
ClientCert: clientAuthCert, ClientCert: clientAuthCert,
ClientKey: clientAuthKey, ClientKey: clientAuthKey,
}) })
if err != nil {
return nil, fmt.Errorf("failed to configure TLS for Vault API: %s", err)
}
client, err := api.NewClient(config) client, err := api.NewClient(config)
if err != nil { if err != nil {