Print error if p12 was empty/failed to parse

This commit is contained in:
Cedric Staub
2016-06-11 10:44:27 -07:00
parent b1be150ab1
commit d449f162c9
+3
View File
@@ -212,6 +212,9 @@ func getCerts(reader io.Reader, filename string, format string) ([]certWithAlias
if err != nil {
return nil, err
}
if len(blocks) == 0 {
return nil, fmt.Errorf("keystore appears to be empty or password was incorrect")
}
for _, block := range blocks {
if block.Type == "CERTIFICATE" {
cert, err := x509.ParseCertificate(block.Bytes)