Skip to content

Commit bf9b34c

Browse files
authored
Accept application/pkcs7-mime to parse certificate. (letsencrypt#4797)
When downloading a pkcs7 file to parse for issuer, some servers appear to deliver application/pkcs7-mime Content-Type and others application/x-pkcs-mime. This patch changes the conditional to look for both to invoke parseCMS().
1 parent 2205300 commit bf9b34c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/ocsp/helper/helper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ func getIssuer(cert *x509.Certificate) (*x509.Certificate, error) {
4141
return nil, err
4242
}
4343
var issuer *x509.Certificate
44-
if resp.Header.Get("Content-Type") == "application/x-pkcs7-mime" {
44+
contentType := resp.Header.Get("Content-Type")
45+
if contentType == "application/x-pkcs7-mime" || contentType == "application/pkcs7-mime" {
4546
issuer, err = parseCMS(body)
4647
} else {
4748
issuer, err = parse(body)

0 commit comments

Comments
 (0)