mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/x509: return a better error when we fail to load system roots.
R=golang-dev, krautz, rsc CC=golang-dev https://golang.org/cl/7157044
This commit is contained in:
parent
0fb6f5f21b
commit
5b5d3efcf3
7 changed files with 63 additions and 17 deletions
|
|
@ -27,9 +27,11 @@ func initSystemRoots() {
|
|||
data, err := ioutil.ReadFile(file)
|
||||
if err == nil {
|
||||
roots.AppendCertsFromPEM(data)
|
||||
break
|
||||
systemRoots = roots
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
systemRoots = roots
|
||||
// All of the files failed to load. systemRoots will be nil which will
|
||||
// trigger a specific error at verification time.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue