Skip to content

Commit e39dba4

Browse files
committed
compiler/natives/src/crypto/x509: Update package and tests for Go 1.9.
Skip new Go 1.9 Linux-only test TestEnvVars that depends on system roots, which GopherJS doesn't support. This is quite okay, as they're not supported on Windows either: 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") } return loadSystemRoots() } Return non-nil error in loadSystemRoots so that x509.SystemCertPool correctly reports a failure. As a result, need to skip TestSystemCertPool now too. There's no need to override execSecurityRoots, because nothing needs or calls it (the things that do are overridden or skipped).
1 parent dcc17c5 commit e39dba4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

compiler/natives/src/crypto/x509/x509.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22

33
package x509
44

5-
import "os"
5+
import "errors"
66

77
func loadSystemRoots() (*CertPool, error) {
8-
// no system roots
9-
return NewCertPool(), nil
10-
}
11-
12-
func execSecurityRoots() (*CertPool, error) {
13-
return nil, os.ErrNotExist
8+
return nil, errors.New("crypto/x509: system root pool is not available in GopherJS")
149
}

compiler/natives/src/crypto/x509/x509_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ package x509
44

55
import "testing"
66

7+
func TestSystemCertPool(t *testing.T) {
8+
t.Skip("no system roots")
9+
}
10+
711
func TestSystemRoots(t *testing.T) {
812
t.Skip("no system roots")
913
}
1014

15+
func TestEnvVars(t *testing.T) {
16+
t.Skip("no system roots")
17+
}
18+
1119
func TestSystemVerify(t *testing.T) {
1220
t.Skip("no system")
1321
}

0 commit comments

Comments
 (0)