File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -809,11 +809,6 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
809
809
810
810
< dl id ="crypto_x509 "> < dt > < a href ="/pkg/crypto/x509/ "> crypto/x509</ a > </ dt >
811
811
< dd >
812
- < p > <!-- CL 30578 -->
813
- < a href ="/pkg/crypto/x509/#SystemCertPool "> < code > SystemCertPool</ code > </ a >
814
- is now implemented on Windows.
815
- </ p >
816
-
817
812
< p > <!-- CL 24743 -->
818
813
PSS signatures are now supported.
819
814
</ p >
Original file line number Diff line number Diff line change 4
4
5
5
package x509
6
6
7
- import "encoding/pem"
7
+ import (
8
+ "encoding/pem"
9
+ "errors"
10
+ "runtime"
11
+ )
8
12
9
13
// CertPool is a set of certificates.
10
14
type CertPool struct {
@@ -26,6 +30,11 @@ func NewCertPool() *CertPool {
26
30
// Any mutations to the returned pool are not written to disk and do
27
31
// not affect any other pool.
28
32
func SystemCertPool () (* CertPool , error ) {
33
+ if runtime .GOOS == "windows" {
34
+ // Issue 16736, 18609:
35
+ return nil , errors .New ("crypto/x509: system root pool is not available on Windows" )
36
+ }
37
+
29
38
return loadSystemRoots ()
30
39
}
31
40
Original file line number Diff line number Diff line change @@ -226,6 +226,11 @@ func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate
226
226
}
227
227
228
228
func loadSystemRoots () (* CertPool , error ) {
229
+ // TODO: restore this functionality on Windows. We tried to do
230
+ // it in Go 1.8 but had to revert it. See Issue 18609.
231
+ // Returning (nil, nil) was the old behavior, prior to CL 30578.
232
+ return nil , nil
233
+
229
234
const CRYPT_E_NOT_FOUND = 0x80092004
230
235
231
236
store , err := syscall .CertOpenSystemStore (0 , syscall .StringToUTF16Ptr ("ROOT" ))
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import (
24
24
"net"
25
25
"os/exec"
26
26
"reflect"
27
+ "runtime"
27
28
"strings"
28
29
"testing"
29
30
"time"
@@ -1477,6 +1478,9 @@ func TestMultipleRDN(t *testing.T) {
1477
1478
}
1478
1479
1479
1480
func TestSystemCertPool (t * testing.T ) {
1481
+ if runtime .GOOS == "windows" {
1482
+ t .Skip ("not implemented on Windows; Issue 16736, 18609" )
1483
+ }
1480
1484
_ , err := SystemCertPool ()
1481
1485
if err != nil {
1482
1486
t .Fatal (err )
You can’t perform that action at this time.
0 commit comments