{"id":325,"date":"2026-03-27T00:00:00","date_gmt":"2026-03-27T00:00:00","guid":{"rendered":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/03\/27\/workers-new-rfc-9440-mtls-certificate-fields-in-workers\/"},"modified":"2026-03-27T00:00:00","modified_gmt":"2026-03-27T00:00:00","slug":"workers-new-rfc-9440-mtls-certificate-fields-in-workers","status":"publish","type":"post","link":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/03\/27\/workers-new-rfc-9440-mtls-certificate-fields-in-workers\/","title":{"rendered":"Workers &#8211; New RFC 9440 mTLS certificate fields in Workers"},"content":{"rendered":"<p>Four new fields are now available on <code>request.cf.tlsClientAuth<\/code> in Workers for requests that include a mutual TLS (mTLS) client certificate. These fields encode the client certificate and its intermediate chain in <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9440\" target=\"_blank\">RFC 9440<\/a> format \u2014 the same standard format used by the <code>Client-Cert<\/code> and <code>Client-Cert-Chain<\/code> HTTP headers \u2014 so your Worker can forward them directly to your origin without any custom parsing or encoding logic.<\/p>\n<h4>New fields<\/h4>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>certRFC9440<\/code><\/td>\n<td>String<\/td>\n<td>The client leaf certificate in RFC 9440 format (<code>:base64-DER:<\/code>). Empty if no client certificate was presented.<\/td>\n<\/tr>\n<tr>\n<td><code>certRFC9440TooLarge<\/code><\/td>\n<td>Boolean<\/td>\n<td><code>true<\/code> if the leaf certificate exceeded 10 KB and was omitted from <code>certRFC9440<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><code>certChainRFC9440<\/code><\/td>\n<td>String<\/td>\n<td>The intermediate certificate chain in RFC 9440 format as a comma-separated list. Empty if no intermediates were sent or if the chain exceeded 16 KB.<\/td>\n<\/tr>\n<tr>\n<td><code>certChainRFC9440TooLarge<\/code><\/td>\n<td>Boolean<\/td>\n<td><code>true<\/code> if the intermediate chain exceeded 16 KB and was omitted from <code>certChainRFC9440<\/code>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Example: forwarding client certificate headers to your origin<\/h4>\n<div>\n<figure>\n<pre data-language=\"js\"><code class=\"language-js\"><div><div><span>export<\/span><span> <\/span><span>default<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span>  <\/span><span>async<\/span><span> <\/span><span>fetch<\/span><span>(<\/span><span>request<\/span><span>)<\/span><span> <\/span><span>{<\/span><\/div><\/div><div><div><span>    <\/span><span>const<\/span><span> <\/span><span>tls<\/span><span> <\/span><span>=<\/span><span> <\/span><span>request<\/span><span>.<\/span><span>cf<\/span><span>.<\/span><span>tlsClientAuth<\/span><span>;<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>    <\/span><span>\/\/ Only forward if cert was verified and chain is complete<\/span><\/div><\/div><div><div><span>    <\/span><span>if<\/span><span> (<\/span><span><span>!<\/span><span>tls<\/span><\/span><span> <\/span><span>||<\/span><span> <\/span><span>!<\/span><span>tls<\/span><span>.<\/span><span>certVerified<\/span><span> <\/span><span>||<\/span><span> <\/span><span>tls<\/span><span>.<\/span><span>certRevoked<\/span><span> <\/span><span>||<\/span><span> <\/span><span>tls<\/span><span>.<\/span><span>certChainRFC9440TooLarge<\/span><span>) <\/span><span>{<\/span><\/div><\/div><div><div><span>      <\/span><span>return<\/span><span> <\/span><span>new<\/span><span> <\/span><span>Response<\/span><span>(<\/span><span>\"Unauthorized\"<\/span><span>,<\/span><span> <\/span><span>{<\/span><span> status<\/span><span>:<\/span><span> <\/span><span>401<\/span><span> <\/span><span>}<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div><span>    <\/span><span>}<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>    <\/span><span>const<\/span><span> <\/span><span>headers<\/span><span> <\/span><span>=<\/span><span> <\/span><span>new<\/span><span> <\/span><span>Headers<\/span><span>(<\/span><span>request<\/span><span>.<\/span><span>headers<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div><span><span>    <\/span><\/span><span>headers<\/span><span>.<\/span><span>set<\/span><span>(<\/span><span>\"Client-Cert\"<\/span><span>,<\/span><span> <\/span><span>tls<\/span><span>.<\/span><span>certRFC9440<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div><span><span>    <\/span><\/span><span>headers<\/span><span>.<\/span><span>set<\/span><span>(<\/span><span>\"Client-Cert-Chain\"<\/span><span>,<\/span><span> <\/span><span>tls<\/span><span>.<\/span><span>certChainRFC9440<\/span><span>)<\/span><span>;<\/span><\/div><\/div><div><div>\n<\/div><\/div><div><div><span>    <\/span><span>return<\/span><span> <\/span><span>fetch<\/span><span>(<\/span><span>new<\/span><span> <\/span><span>Request<\/span><span>(<\/span><span>request<\/span><span>,<\/span><span> <\/span><span>{<\/span><span> <\/span><span>headers<\/span><span> <\/span><span>}<\/span><span>))<\/span><span>;<\/span><\/div><\/div><div><div><span>  <\/span><span>},<\/span><\/div><\/div><div><div><span>};<\/span><\/div><\/div><\/code><\/pre>\n<div>\n<div><\/div>\n<\/div>\n<\/figure>\n<\/div>\n<p>For more information, refer to <a href=\"https:\/\/developers.cloudflare.com\/ssl\/client-certificates\/client-certificate-variables\/#workers-variables\">Client certificate variables<\/a> and <a href=\"https:\/\/developers.cloudflare.com\/cloudflare-one\/access-controls\/service-credentials\/mutual-tls-authentication\/\">Mutual TLS authentication<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Four new fields are now available on request.cf.tlsClientAuth in Workers for requests that include a mutual TLS (mTLS) client certificate. These fields encode the client certificate and its intermediate chain in RFC 9440 format \u2014 the same standard format used by the Client-Cert and Client-Cert-Chain HTTP headers \u2014 so your Worker can forward them directly [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-325","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/comments?post=325"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/325\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/media?parent=325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/categories?post=325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/tags?post=325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}