Display system CA error only if there is an error (#870)

This commit is contained in:
mscherer 2022-04-05 14:37:02 +02:00 committed by GitHub
parent cddc54bae4
commit 1fb8003294
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,7 +37,9 @@ func NewClient(c *cli.Context) (woodpecker.Client, error) {
// attempt to find system CA certs
certs, err := x509.SystemCertPool()
log.Error().Msgf("failed to find system CA certs: %v", err)
if err != nil {
log.Error().Msgf("failed to find system CA certs: %v", err)
}
tlsConfig := &tls.Config{
RootCAs: certs,
InsecureSkipVerify: skip,