Workers - New RFC 9440 mTLS certificate fields in Workers
Key Points
- RFC 9440-formatted leaf and chain fields added
- Leaf omitted if >10 KB; chain omitted if >16 KB
- Forward certs to origin without re-encoding
Summary
Four new fields are available on request.cf.tlsClientAuth for requests that present an mTLS client certificate. They expose the client leaf certificate and intermediate chain in RFC 9440 format so a Worker can forward them directly to your origin without custom parsing or re-encoding.
Key Points
- New fields on request.cf.tlsClientAuth:
certRFC9440(String): client leaf certificate in RFC 9440:base64-DER:format. Empty if no client cert was presented or omitted when too large.certRFC9440TooLarge(Boolean): true if the leaf certificate exceeded 10 KB and was omitted fromcertRFC9440.certChainRFC9440(String): intermediate certificate chain as a comma-separated list of RFC 9440 entries. Empty if no intermediates or omitted when too large.certChainRFC9440TooLarge(Boolean): true if the intermediate chain exceeded 16 KB and was omitted fromcertChainRFC9440.
- These fields match the same format used by the
Client-CertandClient-Cert-ChainHTTP headers, enabling direct forwarding to origin.
Practical usage
- Validate before forwarding: ensure
request.cf.tlsClientAuthexists,certVerified === true, andcertRevoked === false. - Check size flags (
certRFC9440TooLarge,certChainRFC9440TooLarge) and handle omitted fields appropriately. - Typical forwarding: set headers like
Client-Cert=certRFC9440andClient-Cert-Chain=certChainRFC9440when present.
This update simplifies handling and forwarding of mTLS client certificates from Workers in a standard, interoperable format.