Skip to content

Commit

Permalink
Merge b555912 into 6f2c894
Browse files Browse the repository at this point in the history
  • Loading branch information
buger committed Jul 10, 2019
2 parents 6f2c894 + b555912 commit 424d0f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions certs/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ func ParsePEM(data []byte, secret string) ([]*pem.Block, error) {
if x509.IsEncryptedPEMBlock(block) {
var err error
block.Bytes, err = x509.DecryptPEMBlock(block, []byte(secret))
block.Headers = nil
block.Type = strings.Replace(block.Type, "ENCRYPTED ", "", 1)

if err != nil {
return nil, err
Expand Down Expand Up @@ -270,6 +272,7 @@ func (c *CertificateManager) List(certIDs []string, mode CertificateType) (out [
cert, err = ParsePEMCertificate(rawCert, c.secret)
if err != nil {
c.logger.Error("Error while parsing certificate: ", id, " ", err)
c.logger.Error("Failed certificate: ", string(rawCert))
out = append(out, nil)
continue
}
Expand Down

0 comments on commit 424d0f6

Please sign in to comment.