Client certificate variables
Last updated Apr 17, 2026
When a request includes a client certificate for mTLS authentication, Cloudflare exposes certificate details as variables in the Ruleset Engine and as properties on the Workers request.cf object.
Ruleset Engine fields
Client certificate fields are available as mTLS fields in Ruleset Engine-based products such as WAF custom rules and request header modification rules.
Workers variables
These variables are also available as part of the request.cf.tlsClientAuth object via Cloudflare Workers. Refer to the linked Rules language field for the full definition.
Note
Some tlsClientAuth properties have a different type than their Rules language field equivalent. Those differences are called out in the following list.
request.cf.tlsClientAuth.certRevoked— Indicates whether the mTLS client presented a valid but revoked client certificate. In Workers, this is a string ("1"for revoked,"0"for not revoked) rather than a boolean.request.cf.tlsClientAuth.certVerified— Indicates whether the mTLS client presented a valid client certificate. In Workers, this is a string ("SUCCESS"when valid,"NONE"when not present) rather than a boolean. On failure, the string contains the error reason (for example,"FAILED:unable to get local issuer certificate").request.cf.tlsClientAuth.certPresented— Indicates whether the mTLS client presented a certificate (valid or not). In Workers, this is a string ("1"when a certificate is presented,"0"otherwise) rather than a boolean.request.cf.tlsClientAuth.certIssuerDN— The Distinguished Name (DN) of the Certificate Authority (CA) that issued the mTLS client certificate.request.cf.tlsClientAuth.certSubjectDN— The Distinguished Name (DN) of the owner (or requester) of the mTLS client certificate.request.cf.tlsClientAuth.certIssuerDNRFC2253— The Distinguished Name (DN) of the Certificate Authority (CA) that issued the mTLS client certificate in RFC 2253 ↗︎ format.request.cf.tlsClientAuth.certSubjectDNRFC2253— The Distinguished Name (DN) of the owner (or requester) of the mTLS client certificate in RFC 2253 ↗︎ format.request.cf.tlsClientAuth.certIssuerDNLegacy— The Distinguished Name (DN) of the Certificate Authority (CA) that issued the mTLS client certificate in a legacy format.request.cf.tlsClientAuth.certSubjectDNLegacy— The Distinguished Name (DN) of the owner (or requester) of the mTLS client certificate in a legacy format.request.cf.tlsClientAuth.certSerial— Serial number of the mTLS client certificate.request.cf.tlsClientAuth.certIssuerSerial— Serial number of the direct issuer of the mTLS client certificate.request.cf.tlsClientAuth.certFingerprintSHA256— The SHA-256 fingerprint of the mTLS client certificate.request.cf.tlsClientAuth.certFingerprintSHA1— The SHA-1 fingerprint of the mTLS client certificate.request.cf.tlsClientAuth.certNotBefore— The mTLS client certificate is not valid before this date.request.cf.tlsClientAuth.certNotAfter— The mTLS client certificate is not valid after this date.request.cf.tlsClientAuth.certSKI— The Subject Key Identifier (SKI) of the mTLS client certificate.request.cf.tlsClientAuth.certIssuerSKI— The Subject Key Identifier (SKI) of the direct issuer of the mTLS client certificate.request.cf.tlsClientAuth.certRFC9440— The client leaf certificate encoded in RFC 9440 ↗︎ format (DER, Base64-encoded, colon-wrapped).request.cf.tlsClientAuth.certRFC9440TooLarge—trueif the leaf certificate exceeded the 10 KiB encoding limit and was omitted fromcertRFC9440.request.cf.tlsClientAuth.certChainRFC9440— The intermediate certificate chain in RFC 9440 ↗︎ format as a comma-separated list.request.cf.tlsClientAuth.certChainRFC9440TooLarge—trueif the intermediate chain exceeded the 16 KiB encoding limit and was omitted fromcertChainRFC9440.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ssl/client-certificates/client-certificate-variables/#page","headline":"Client certificate variables","description":"Variables available in WAF rules when using client certificates.","url":"https://developers.cloudflare.com/ssl/client-certificates/client-certificate-variables/","inLanguage":"en","image":"https://developers.cloudflare.com/ssl/client-certificates/client-certificate-variables/og.png?v=1092325fc5b2749f","dateModified":"2026-04-17","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["mTLS"]}
description: This tutorial demonstrates how to configure your Internet-of-things (IoT) device and mobile application to use client certificates with API Shield. title: Configure your mobile app or IoT device image: https://developers.cloudflare.com/ssl/client-certificates/configure-your-mobile-app-or-iot-device/og.png?v=6ab04df5b7dcb745
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/ssl/llms.txt
Use this file to discover all available pages before exploring further.
Docs