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

Backport #870
Close #1281

Co-authored-by: mscherer <mscherer@users.noreply.github.com>
This commit is contained in:
6543 2022-10-18 10:09:15 +02:00 committed by GitHub
parent 5d95a7cede
commit 3127ba9c7c
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,