This is a test commit. DO NOT MERGE.

Signed-off-by: Wahab Ali <wahabalimk@gmail.com>
pull/9319/head
Wahab Ali 5 years ago
parent 37c529efeb
commit 96383c1d91

@ -20,7 +20,6 @@ import (
"crypto/tls" "crypto/tls"
"crypto/x509" "crypto/x509"
"io/ioutil" "io/ioutil"
"runtime"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
@ -60,14 +59,9 @@ func CertPoolFromFile(filename string) (*x509.CertPool, error) {
return nil, errors.Errorf("can't read CA file: %v", filename) return nil, errors.Errorf("can't read CA file: %v", filename)
} }
var cp *x509.CertPool cp, err := x509.SystemCertPool()
if runtime.GOOS == "windows" { if err != nil {
cp = x509.NewCertPool() return nil, errors.Wrap(err, "failed to load system cert pool")
} else {
cp, err = x509.SystemCertPool()
if err != nil {
return nil, errors.Wrap(err, "failed to load system cert pool")
}
} }
if !cp.AppendCertsFromPEM(b) { if !cp.AppendCertsFromPEM(b) {

Loading…
Cancel
Save