From 1fb800329488de74c9db7cfc5dc43fb5a4efbad8 Mon Sep 17 00:00:00 2001 From: mscherer Date: Tue, 5 Apr 2022 14:37:02 +0200 Subject: [PATCH] Display system CA error only if there is an error (#870) --- cli/internal/util.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/internal/util.go b/cli/internal/util.go index 74a0b4acc..96daeff8d 100644 --- a/cli/internal/util.go +++ b/cli/internal/util.go @@ -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,