Accept "NEW CERTIFICATE REQUEST" PEM headers

Fixes #301
This commit is contained in:
Filippo Valsorda
2020-10-25 17:59:00 +01:00
parent 8e71a281f9
commit ea8260d0d9

View File

@@ -208,7 +208,8 @@ func (m *mkcert) makeCertFromCSR() {
if csrPEM == nil { if csrPEM == nil {
log.Fatalln("ERROR: failed to read the CSR: unexpected content") log.Fatalln("ERROR: failed to read the CSR: unexpected content")
} }
if csrPEM.Type != "CERTIFICATE REQUEST" { if csrPEM.Type != "CERTIFICATE REQUEST" &&
csrPEM.Type != "NEW CERTIFICATE REQUEST" {
log.Fatalln("ERROR: failed to read the CSR: expected CERTIFICATE REQUEST, got " + csrPEM.Type) log.Fatalln("ERROR: failed to read the CSR: expected CERTIFICATE REQUEST, got " + csrPEM.Type)
} }
csr, err := x509.ParseCertificateRequest(csrPEM.Bytes) csr, err := x509.ParseCertificateRequest(csrPEM.Bytes)