Skip to content

Commit

Permalink
System root pool is not available for windows
Browse files Browse the repository at this point in the history
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
  • Loading branch information
praveenkumar committed Sep 28, 2021
1 parent 8ff513c commit 79880a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ func main() {
// Get the system certificate pools
caCertPool, err := x509.SystemCertPool()
if err != nil {
log.Fatalf("Not able to get system certificate pool %v", err)
log.Printf("Not able to get system certificate pool %v", err)
caCertPool = x509.NewCertPool()
}
caCert, err := ioutil.ReadFile(caCertPath)
if err != nil {
Expand Down

0 comments on commit 79880a2

Please sign in to comment.