TUN-833: Don't log system root certificate loading failure on Windows

This commit is contained in:
Areg Harutyunyan 2018-08-27 13:53:08 -05:00
parent 60ca06d020
commit bda1c005fe
1 changed files with 4 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import (
"github.com/cloudflare/cloudflared/log" "github.com/cloudflare/cloudflared/log"
"github.com/pkg/errors" "github.com/pkg/errors"
"gopkg.in/urfave/cli.v2" "gopkg.in/urfave/cli.v2"
"runtime"
) )
var logger = log.CreateLogger() var logger = log.CreateLogger()
@ -84,7 +85,9 @@ func LoadGlobalCertPool() (*x509.CertPool, error) {
// First, obtain the system certificate pool // First, obtain the system certificate pool
certPool, systemCertPoolErr := x509.SystemCertPool() certPool, systemCertPoolErr := x509.SystemCertPool()
if systemCertPoolErr != nil { if systemCertPoolErr != nil {
if runtime.GOOS != "windows" {
logger.Warnf("error obtaining the system certificates: %s", systemCertPoolErr) logger.Warnf("error obtaining the system certificates: %s", systemCertPoolErr)
}
certPool = x509.NewCertPool() certPool = x509.NewCertPool()
} else { } else {
success = true success = true