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