Skip to content

Commit

Permalink
fix diag messages
Browse files Browse the repository at this point in the history
  • Loading branch information
BARRY Thierno Ibrahima (Canal Plus Prestataire) committed May 4, 2021
1 parent 0a84c06 commit 8123e1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/provider/data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ func dataSourceRead(ctx context.Context, d *schema.ResourceData, meta interface{
// Get the System Cert Pool
caCertPool, err := x509.SystemCertPool()
if err != nil {
return fmt.Errorf("Error tls: %s", err)
return append(diags, diag.Errorf("Error tls: %s", err)...)
}

// Use `ca_certificate` cert pool
if caCert != "" {
caCertPool = x509.NewCertPool()
if ok := caCertPool.AppendCertsFromPEM([]byte(caCert)); !ok {
return fmt.Errorf("Error tls: Can't add the CA certificate to certificate pool")
return append(diags, diag.Errorf("Error tls: Can't add the CA certificate to certificate pool")...)
}
}

Expand Down

0 comments on commit 8123e1b

Please sign in to comment.