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:
Adam Langley 2013-01-21 11:25:28 -05:00
parent 0fb6f5f21b
commit 5b5d3efcf3
7 changed files with 63 additions and 17 deletions

View file

@ -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.
}