Skip to content

Commit

Permalink
Added better error message when PEM parsing fails.
Browse files Browse the repository at this point in the history
Suggested by: #104 (comment)

Signed-off-by: Martin René Sørensen <[email protected]>
  • Loading branch information
sicet7 committed Nov 19, 2024
1 parent 2086670 commit f656464
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kv/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func NewRedisDriver(log *zap.Logger, key string, cfgPlugin Configurer, tracer *s
}

if !rootCAs.AppendCertsFromPEM(bytes) {
return nil, errors.E(op, errors.Errorf("failed to append certs from PEM file: %s", d.cfg.TLSConfig.CaFile))
return nil, errors.E(op, errors.Errorf("failed to parse certificates from PEM file '%s'. Please ensure the file contains valid PEM-encoded certificates", d.cfg.TLSConfig.CaFile))
}

tlsConfig.RootCAs = rootCAs
Expand Down

0 comments on commit f656464

Please sign in to comment.