Skip to content

Commit 79880a2

Browse files
committed
System root pool is not available for windows
As per https://golang.org/src/crypto/x509/cert_pool.go looks like there is no implementation of `SystemCertPool` for windows platform and it just return the error. ``` func SystemCertPool() (*CertPool, error) { if runtime.GOOS == "windows" { // Issue 16736, 18609: return nil, errors.New("crypto/x509: system root pool is not available on Windows") } .... ``` - golang/go#16736 - golang/go#46287
1 parent 8ff513c commit 79880a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ func main() {
5757
// Get the system certificate pools
5858
caCertPool, err := x509.SystemCertPool()
5959
if err != nil {
60-
log.Fatalf("Not able to get system certificate pool %v", err)
60+
log.Printf("Not able to get system certificate pool %v", err)
61+
caCertPool = x509.NewCertPool()
6162
}
6263
caCert, err := ioutil.ReadFile(caCertPath)
6364
if err != nil {

0 commit comments

Comments
 (0)