csr: support NEW CERTIFICATE REQUEST as CSR type (#1423)

This commit is contained in:
Ludovic Fernandez 2021-06-05 13:47:39 +02:00 committed by GitHub
parent 1af3abd16e
commit e79975cf14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -179,7 +179,7 @@ func PemDecodeTox509CSR(data []byte) (*x509.CertificateRequest, error) {
return nil, err
}
if pemBlock.Type != "CERTIFICATE REQUEST" {
if pemBlock.Type != "CERTIFICATE REQUEST" && pemBlock.Type != "NEW CERTIFICATE REQUEST" {
return nil, errors.New("PEM block is not a certificate request")
}

View file

@ -117,7 +117,7 @@ func readCSRFile(filename string) (*x509.CertificateRequest, error) {
}
// did we get a CSR?
if p.Type == "CERTIFICATE REQUEST" {
if p.Type == "CERTIFICATE REQUEST" || p.Type == "NEW CERTIFICATE REQUEST" {
raw = p.Bytes
}
}