Skip to content

client-certificate-auth API Reference


client-certificate-auth API Reference / parsers / parseRfc9440

Function: parseRfc9440() ​

parseRfc9440(headerValue): PeerCertificate | null

Defined in: parsers.js:476

Parse an RFC 9440 Client-Cert value: an RFC 8941 Byte Sequence, i.e. base64 DER between colons and nothing else. Cloudflare's RFC 9440 forwarding and Google Cloud's {client_cert_leaf} variable both produce this form. Anything outside the colons (parameters, joined repeats, bare base64) is rejected.

Parameters ​

headerValue ​

string

RFC 9440 formatted certificate

Returns ​

PeerCertificate | null

Parsed certificate or null on failure

See ​

https://datatracker.ietf.org/doc/html/rfc9440#section-2.1

Released under the MIT License.