]> Cypherpunks repositories - gostls13.git/commit
crypto/x509: add SystemCertPool, refactor system cert pool loading
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 30 Mar 2016 05:41:18 +0000 (16:41 +1100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 31 Mar 2016 07:52:10 +0000 (07:52 +0000)
commita62ae9f62fcfca02075b70e6e0aa757f4fd8f5ec
tree7ddffee019d7e4127e59def1982f7a2eeb42cfa4
parent71ab3c1ccfebbc065c10531e4846f02d44f4be0d
crypto/x509: add SystemCertPool, refactor system cert pool loading

This exports the system cert pool.

The system cert loading was refactored to let it be run multiple times
(so callers get a copy, and can't mutate global state), and also to
not discard errors.

SystemCertPool returns an error on Windows. Maybe it's fixable later,
but so far we haven't used it, since the system verifies TLS.

Fixes #13335

Change-Id: I3dfb4656a373f241bae8529076d24c5f532f113c
Reviewed-on: https://go-review.googlesource.com/21293
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/crypto/x509/cert_pool.go
src/crypto/x509/root.go
src/crypto/x509/root_cgo_darwin.go
src/crypto/x509/root_darwin_arm_gen.go
src/crypto/x509/root_darwin_armx.go
src/crypto/x509/root_nocgo_darwin.go
src/crypto/x509/root_plan9.go
src/crypto/x509/root_unix.go
src/crypto/x509/root_windows.go
src/crypto/x509/verify.go