fix: load certs on windows from registry (#11016)

fixes #11007
This commit is contained in:
Harshavardhana
2020-12-02 02:23:51 -08:00
committed by GitHub
parent 303be1866d
commit ce0e17b62b
3 changed files with 88 additions and 3 deletions

View File

@@ -26,10 +26,10 @@ import (
// GetRootCAs - returns all the root CAs into certPool
// at the input certsCADir
func GetRootCAs(certsCAsDir string) (*x509.CertPool, error) {
rootCAs, _ := x509.SystemCertPool()
rootCAs, _ := loadSystemRoots()
if rootCAs == nil {
// In some systems (like Windows) system cert pool is
// not supported or no certificates are present on the
// In some systems system cert pool is not supported
// or no certificates are present on the
// system - so we create a new cert pool.
rootCAs = x509.NewCertPool()
}