tempfork/x509: fix build on darwin and windows
These fixes were originally in the updates to CL 229917 after Trybots failed there. See https://go-review.googlesource.com/c/go/+/229917/1..3
This commit is contained in:
@@ -305,8 +305,13 @@ func loadSystemRoots() (*CertPool, error) {
|
||||
untrustedRoots.AppendCertsFromPEM(buf)
|
||||
|
||||
trustedRoots := NewCertPool()
|
||||
for _, c := range roots.certs {
|
||||
if !untrustedRoots.contains(c) {
|
||||
for i := 0; i < roots.len(); i++ {
|
||||
c := roots.mustCert(i)
|
||||
contains, err := untrustedRoots.contains(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !contains {
|
||||
trustedRoots.AddCert(c)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user