use check utl

release-0.4
Fabrizio (Misto) Milo 2013-08-13 11:43:09 -07:00
parent 6299f316f1
commit 0aebf3757d
1 changed files with 3 additions and 5 deletions

View File

@ -340,15 +340,13 @@ func newCertPool(CAFile string) (tls.ClientAuthType, *x509.CertPool) {
if CAFile == "" {
return tls.NoClientCert, nil
}
pemByte, _ := ioutil.ReadFile(CAFile)
pemByte, err := ioutil.ReadFile(CAFile)
check(err)
block, pemByte := pem.Decode(pemByte)
cert, err := x509.ParseCertificate(block.Bytes)
if err != nil {
fatal(err)
}
check(err)
certPool := x509.NewCertPool()