<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.5.21 -->
<?rfc-ext html-pretty-print="prettyprint https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"?>
<rfc xmlns:x="http://purl.org/net/xml2rfc/ext"
     category="info"
     docName="draft-ietf-httpbis-client-cert-field-01"
     ipr="trust200902"
     submissionType="IETF">
   <x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22\&amp;amp;body=%3c{ref}%3e:"/>
   <front>
      <title abbrev="Client-Cert Header">Client-Cert HTTP Header Field</title>
      <author fullname="Brian Campbell" initials="B." surname="Campbell">
         <organization>Ping Identity</organization>
         <address>
            <email>bcampbell@pingidentity.com</email>
         </address>
      </author>
      <author fullname="Mike Bishop"
              initials="M."
              role="editor"
              surname="Bishop">
         <organization>Akamai</organization>
         <address>
            <email>mbishop@evequefou.be</email>
         </address>
      </author>
      <date year="2022" month="January" day="25"/>
      <area>Applications and Real-Time</area>
      <workgroup>HTTP</workgroup>
      <keyword>http</keyword>
      <keyword>client certificate</keyword>
      <abstract>
         <t>This document defines HTTP extension header fields that allow a TLS terminating reverse proxy to convey the client certificate information of a mutually-authenticated TLS connection to the origin server in a common and predictable manner.</t>
      </abstract>
      <note removeInRFC="true" title="About This Document">
         <t>Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ietf-httpbis-client-cert-field/"/>.</t>
         <t>Discussion of this document takes place on the HTTP Working Group mailing list (<eref target="mailto:ietf-http-wg@w3.org"/>), which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/"/>. Working Group information can be found at <eref target="https://httpwg.org/"/>.</t>
         <t>Source for this draft and an issue tracker can be found at <eref target="https://github.com/httpwg/http-extensions/labels/client-cert-field"/>.</t>
      </note>
   </front>
   <middle>
      <section anchor="Introduction">
         <name>Introduction</name>
         <t>A fairly common deployment pattern for HTTPS applications is to have the origin HTTP application servers sit behind a reverse proxy that terminates TLS connections from clients. The proxy is accessible to the internet and dispatches client requests to the appropriate origin server within a private or protected network. The origin servers are not directly accessible by clients and are only reachable through the reverse proxy. The backend details of this type of deployment are typically opaque to clients who make requests to the proxy server and see responses as though they originated from the proxy server itself. Although HTTPS is also usually employed between the proxy and the origin server, the TLS connection that the client establishes for HTTPS is only between itself and the reverse proxy server.</t>
         <t>The deployment pattern is found in a number of varieties such as n-tier architectures, content delivery networks, application load balancing services, and ingress controllers.</t>
         <t>Although not exceedingly prevalent, TLS client certificate authentication is sometimes employed and in such cases the origin server often requires information about the client certificate for its application logic. Such logic might include access control decisions, audit logging, and binding issued tokens or cookies to a certificate, and the respective validation of such bindings. The specific details from the certificate needed also vary with the application requirements. In order for these types of application deployments to work in practice, the reverse proxy needs to convey information about the client certificate to the origin application server. A common way this information is conveyed in practice today is by using non-standard fields to carry the certificate (in some encoding) or individual parts thereof in the HTTP request that is dispatched to the origin server. This solution works but interoperability between independently developed components can be cumbersome or even impossible depending on the implementation choices respectively made (like what field names are used or are configurable, which parts of the certificate are exposed, or how the certificate is encoded). A well-known predictable approach to this commonly occurring functionality could improve and simplify interoperability between independent implementations.</t>
         <t>This document aspires to standardize two HTTP header fields, <spanx style="verb">Client-Cert</spanx> and <spanx style="verb">Client-Cert-Chain</spanx>, which a TLS terminating reverse proxy (TTRP) adds to requests sent to the backend origin servers. The <spanx style="verb">Client-Cert</spanx> field value contains the end-entity client certificate from the mutually-authenticated TLS connection between the originating client and the TTRP. Optionally, the <spanx style="verb">Client-Cert-Chain</spanx> field value contains the certificate chain used for validation of the end-entity certificate. This enables the backend origin server to utilize the client certificate information in its application logic. While there may be additional proxies or hops between the TTRP and the origin server (potentially even with mutually-authenticated TLS connections between them), the scope of the <spanx style="verb">Client-Cert</spanx> header field is intentionally limited to exposing to the origin server the certificate that was presented by the originating client in its connection to the TTRP.</t>
         <section anchor="requirements-notation-and-conventions">
            <name>Requirements Notation and Conventions</name>
            <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/>
               <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
         </section>
         <section anchor="terminology">
            <name>Terminology</name>
            <t>Phrases like TLS client certificate authentication or mutually-authenticated TLS are used throughout this document to refer to the process whereby, in addition to the normal TLS server authentication with a certificate, a client presents its X.509 certificate <xref target="RFC5280"/> and proves possession of the corresponding private key to a server when negotiating a TLS connection or the resumption of such a connection. In contemporary versions of TLS <xref target="RFC8446"/>
               <xref target="RFC5246"/> this requires that the client send the Certificate and CertificateVerify messages during the handshake and for the server to verify the CertificateVerify and Finished messages.</t>
            <t>HTTP/2 restricts TLS 1.2 renegotiation (<xref section="9.2.1" sectionFormat="of" target="RFC7540"/>) and prohibits TLS 1.3 post-handshake authentication <xref target="RFC8740"/>. However, they are sometimes used to implement reactive client certificate authentication in HTTP/1.1 <xref target="RFC7230"/> where the server decides whether to request a client certificate based on the HTTP request. HTTP application data sent on such a connection after receipt and verification of the client certificate is also mutually-authenticated and thus suitable for the mechanisms described in this document.</t>
         </section>
      </section>
      <section anchor="headers">
         <name>HTTP Header Fields and Processing Rules</name>
         <t>This document designates the following headers, defined further in <xref target="header"/> and <xref target="chain-header"/> respectively, to carry the client certificate information of a mutually-authenticated TLS connection from a reverse proxy to origin server.</t>
         <dl>
            <dt>Client-Cert:</dt>
            <dd>
               <t>Conveys the end-entity certificate used by the client in the TLS handshake with the reverse proxy from the reverse proxy to the origin server.</t>
            </dd>
            <dt>Client-Cert-Chain:</dt>
            <dd>
               <t>Conveys the certificate chain used for validation of the end-entity certificate used by the client in the TLS handshake from the reverse proxy to the origin server.</t>
            </dd>
         </dl>
         <section anchor="encoding">
            <name>Encoding</name>
            <t>The headers in this document encode certificates as Structured Field Byte Sequences (<xref section="3.3.5" sectionFormat="of" target="RFC8941"/>) where the value of the binary data is a DER encoded <xref target="ITU.X690.1994"/> X.509 certificate <xref target="RFC5280"/>. In effect, this means that the binary DER certificate is encoded using base64 (without line breaks, spaces, or other characters outside the base64 alphabet) and delimited with colons on either side.</t>
            <t>Note that certificates are often stored encoded in a textual format, such as the one described in <xref section="5.1" sectionFormat="of" target="RFC7468"/>, which is already nearly compatible with a Structured Field Byte Sequence; if so, it will be sufficient to replace <spanx style="verb">---(BEGIN|END) CERTIFICATE---</spanx> with <spanx style="verb">:</spanx> and remove line breaks in order to generate an appropriate item.</t>
         </section>
         <section anchor="header">
            <name>Client-Cert HTTP Header Field</name>
            <t>In the context of a TLS terminating reverse proxy deployment, the proxy makes the TLS client certificate available to the backend application with the Client-Cert HTTP header field. This field contains the end-entity certificate used by the client in the TLS handshake.</t>
            <t>Client-Cert is an Item Structured Header <xref target="RFC8941"/>. Its value <bcp14>MUST</bcp14> be a Byte Sequence (<xref section="3.3.5" sectionFormat="of" target="RFC8941"/>). Its ABNF is:</t>
            <figure>
               <artwork>
 Client-Cert = sf-binary
</artwork>
            </figure>
            <t>The value of the header is encoded as described in <xref target="encoding"/>.</t>
            <t>The <spanx style="verb">Client-Cert</spanx> header field is only for use in HTTP requests and <bcp14>MUST NOT</bcp14> be used in HTTP responses. It is a single HTTP header field value as defined in <xref target="RFC7230" x:fmt="of" x:sec="3.2"/>, which <bcp14>MUST NOT</bcp14> have a list of values or occur multiple times in a request.</t>
         </section>
         <section anchor="chain-header">
            <name>Client-Cert-Chain HTTP Header Field</name>
            <t>In the context of a TLS terminating reverse proxy deployment, the proxy <bcp14>MAY</bcp14> make the certificate chain used for validation of the end-entity certificate available to the backend application with the Client-Cert-Chain HTTP header field. This field contains certificates used by the proxy to validate the certificate used by the client in the TLS handshake. These certificates might or might not have been provided by the client during the TLS handshake.</t>
            <t>Client-Cert-Chain is a List Structured Header <xref target="RFC8941"/>. Each item in the list <bcp14>MUST</bcp14> be a Byte Sequence (<xref section="3.3.5" sectionFormat="of" target="RFC8941"/>) encoded as described in <xref target="encoding"/>.</t>
            <t>The header's ABNF is:</t>
            <figure>
               <artwork>
 Client-Cert-Chain = sf-list
</artwork>
            </figure>
            <t>The <spanx style="verb">Client-Cert-Chain</spanx> header field is only for use in HTTP requests and <bcp14>MUST NOT</bcp14> be used in HTTP responses. It <bcp14>MAY</bcp14> have a list of values or occur multiple times in a request. For header compression purposes, it might be advantageous to split lists into multiple instances.</t>
            <t>The first certificate in the list <bcp14>SHOULD</bcp14> directly certify the end-entity certificate provided in the <spanx style="verb">Client-Cert</spanx> header; each following certificate <bcp14>SHOULD</bcp14> directly certify the one immediately preceding it. Because certificate validation requires that trust anchors be distributed independently, a certificate that specifies a trust anchor <bcp14>MAY</bcp14> be omitted from the chain, provided that the server is known to possess any omitted certificates.</t>
            <t>However, for maximum compatibility, servers <bcp14>SHOULD</bcp14> be prepared to handle potentially extraneous certificates and arbitrary orderings.</t>
         </section>
         <section anchor="processing-rules">
            <name>Processing Rules</name>
            <t>This section outlines the applicable processing rules for a TLS terminating reverse proxy (TTRP) that has negotiated a mutually-authenticated TLS connection to convey the client certificate from that connection to the backend origin servers. Use of the technique is to be a configuration or deployment option and the processing rules described herein are for servers operating with that option enabled.</t>
            <t>A TTRP negotiates the use of a mutually-authenticated TLS connection with the client, such as is described in <xref target="RFC8446"/> or <xref target="RFC5246"/>, and validates the client certificate per its policy and trusted certificate authorities. Each HTTP request on the underlying TLS connection are dispatched to the origin server with the following modifications:</t>
            <t>
               <list style="numbers">
                  <t>The client certificate is placed in the <spanx style="verb">Client-Cert</spanx> header field of the dispatched request, as described in <xref target="header"/>.</t>
                  <t>If so configured, the validation chain of the client certificate is placed in the <spanx style="verb">Client-Cert-Chain</spanx> header field of the request, as described in <xref target="chain-header"/>.</t>
                  <t>Any occurrence of the <spanx style="verb">Client-Cert</spanx> or <spanx style="verb">Client-Cert-Chain</spanx> header fields in the original incoming request <bcp14>MUST</bcp14> be removed or overwritten before forwarding the request. An incoming request that has a <spanx style="verb">Client-Cert</spanx> or <spanx style="verb">Client-Cert-Chain</spanx> header field <bcp14>MAY</bcp14> be rejected with an HTTP 400 response.</t>
               </list>
            </t>
            <t>Requests made over a TLS connection where the use of client certificate authentication was not negotiated <bcp14>MUST</bcp14> be sanitized by removing any and all occurrences of the <spanx style="verb">Client-Cert</spanx> and <spanx style="verb">Client-Cert-Chain</spanx> header fields prior to dispatching the request to the backend server.</t>
            <t>Backend origin servers may then use the <spanx style="verb">Client-Cert</spanx> header field of the request to determine if the connection from the client to the TTRP was mutually-authenticated and, if so, the certificate thereby presented by the client.</t>
            <t>Forward proxies and other intermediaries <bcp14>MUST NOT</bcp14> add the <spanx style="verb">Client-Cert</spanx> or <spanx style="verb">Client-Cert-Chain</spanx> header fields to requests, or modify an existing <spanx style="verb">Client-Cert</spanx> or <spanx style="verb">Client-Cert-Chain</spanx> header field. Similarly, clients <bcp14>MUST NOT</bcp14> employ the <spanx style="verb">Client-Cert</spanx> or <spanx style="verb">Client-Cert-Chain</spanx> header field in requests.</t>
            <t>When the value of the <spanx style="verb">Client-Cert</spanx> request header field is used to select a response (e.g., the response content is access-controlled), the response <bcp14>MUST</bcp14> either be uncacheable (e.g., by sending <spanx style="verb">Cache-Control: no-store</spanx>) or be designated for selective reuse only for subsequent requests with the same <spanx style="verb">Client-Cert</spanx> header value by sending a <spanx style="verb">Vary: Client-Cert</spanx> response header. If a TTRP encounters a response with a <spanx style="verb">client-cert</spanx> field name in the <spanx style="verb">Vary</spanx> header field, it <bcp14>SHOULD</bcp14> prevent the user agent from caching the response by transforming the value of the <spanx style="verb">Vary</spanx> response header field to <spanx style="verb">*</spanx>.</t>
         </section>
      </section>
      <section anchor="deployment">
         <name>Deployment Considerations</name>
         <section anchor="header-field-compression">
            <name>Header Field Compression</name>
            <t>If the client certificate header field is generated by an intermediary on a connection that compresses fields (e.g., using HPACK <xref target="RFC7541"/> or QPACK <xref target="I-D.ietf-quic-qpack"/>) and more than one client's requests are multiplexed into that connection, it can reduce compression efficiency significantly, due to the typical size of the field value and its variation between clients. Recipients that anticipate connections with these characteristics can mitigate the efficiency loss by increasing the size of the dynamic table. If a recipient does not do so, senders may find it beneficial to always send the field value as a literal, rather than entering it into the dynamic table.</t>
         </section>
         <section anchor="header-block-size">
            <name>Header Block Size</name>
            <t>A server in receipt of a larger header block than it is willing to handle can send an HTTP 431 (Request Header Fields Too Large) status code per <xref section="5" sectionFormat="of" target="RFC6585"/>. Due to the typical size of the field values containing certificate data, recipients may need to be configured to allow for a larger maximum header block size. An intermediary generating client certificate header fields on connections that allow for advertising the maximum acceptable header block size (e.g. HTTP/2 <xref target="RFC7540"/> or HTTP/3 <xref target="I-D.ietf-quic-http"/>) should account for the additional size of header block of the requests it sends vs. requests it receives by advertising a value to its clients that is sufficiently smaller so as to allow for the addition of certificate data.</t>
         </section>
      </section>
      <section anchor="sec">
         <name>Security Considerations</name>
         <t>The header fields described herein enable a TTRP and backend or origin server to function together as though, from the client's perspective, they are a single logical server side deployment of HTTPS over a mutually-authenticated TLS connection. Use of the header fields outside that intended use case, however, may undermine the protections afforded by TLS client certificate authentication. Therefore, steps <bcp14>MUST</bcp14> be taken to prevent unintended use, both in sending the header field and in relying on its value.</t>
         <t>Producing and consuming the <spanx style="verb">Client-Cert</spanx> and <spanx style="verb">Client-Cert-Chain</spanx> header fields <bcp14>SHOULD</bcp14> be configurable options, respectively, in a TTRP and backend server (or individual application in that server). The default configuration for both should be to not use the header fields thus requiring an "opt-in" to the functionality.</t>
         <t>In order to prevent field injection, backend servers <bcp14>MUST</bcp14> only accept the <spanx style="verb">Client-Cert</spanx> and <spanx style="verb">Client-Cert-Chain</spanx> header fields from a trusted TTRP (or other proxy in a trusted path from the TTRP). A TTRP <bcp14>MUST</bcp14> sanitize the incoming request before forwarding it on by removing or overwriting any existing instances of the fields. Otherwise, arbitrary clients can control the field values as seen and used by the backend server. It is important to note that neglecting to prevent field injection does not "fail safe" in that the nominal functionality will still work as expected even when malicious actions are possible. As such, extra care is recommended in ensuring that proper field sanitation is in place.</t>
         <t>The communication between a TTRP and backend server needs to be secured against eavesdropping and modification by unintended parties.</t>
         <t>The configuration options and request sanitization are necessarily functionally of the respective servers. The other requirements can be met in a number of ways, which will vary based on specific deployments. The communication between a TTRP and backend or origin server, for example, might be authenticated in some way with the insertion and consumption of the <spanx style="verb">Client-Cert</spanx> and <spanx style="verb">Client-Cert-Chain</spanx> header fields occurring only on that connection. Alternatively the network topology might dictate a private network such that the backend application is only able to accept requests from the TTRP and the proxy can only make requests to that server. Other deployments that meet the requirements set forth herein are also possible.</t>
      </section>
      <section anchor="iana-considerations">
         <name>IANA Considerations</name>
         <section anchor="http-field-name-registrations">
            <name>HTTP Field Name Registrations</name>
            <t>Please register the following entries in the "Hypertext Transfer Protocol (HTTP) Field Name Registry" defined by <xref target="I-D.ietf-httpbis-semantics"/>:</t>
            <t>
               <list style="symbols">
                  <t>Field name: Client-Cert</t>
                  <t>Status: permanent</t>
                  <t>Specification document: <xref target="headers"/> of [this document] <br/>
                  </t>
                  <t>Field name: Client-Cert-Chain</t>
                  <t>Status: permanent</t>
                  <t>Specification document: <xref target="headers"/> of [this document]</t>
               </list>
            </t>
         </section>
      </section>
   </middle>
   <back>
      <references title="Normative References">
         <reference anchor="RFC2119">
            <front>
               <title>Key words for use in RFCs to Indicate Requirement Levels</title>
               <author fullname="S. Bradner" initials="S." surname="Bradner"/>
               <date month="March" year="1997"/>
            </front>
            <seriesInfo name="BCP" value="14"/>
            <seriesInfo name="RFC" value="2119"/>
            <seriesInfo name="DOI" value="10.17487/RFC2119"/>
         </reference>
         <reference anchor="RFC8174">
            <front>
               <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
               <author fullname="B. Leiba" initials="B." surname="Leiba"/>
               <date month="May" year="2017"/>
            </front>
            <seriesInfo name="BCP" value="14"/>
            <seriesInfo name="RFC" value="8174"/>
            <seriesInfo name="DOI" value="10.17487/RFC8174"/>
         </reference>
         <reference anchor="RFC5280">
            <front>
               <title>Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile</title>
               <author fullname="D. Cooper" initials="D." surname="Cooper"/>
               <author fullname="S. Santesson" initials="S." surname="Santesson"/>
               <author fullname="S. Farrell" initials="S." surname="Farrell"/>
               <author fullname="S. Boeyen" initials="S." surname="Boeyen"/>
               <author fullname="R. Housley" initials="R." surname="Housley"/>
               <author fullname="W. Polk" initials="W." surname="Polk"/>
               <date month="May" year="2008"/>
            </front>
            <seriesInfo name="RFC" value="5280"/>
            <seriesInfo name="DOI" value="10.17487/RFC5280"/>
         </reference>
         <reference anchor="ITU.X690.1994">
            <front>
               <title>Information Technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)</title>
               <author>
                  <organization>International Telecommunications Union</organization>
               </author>
               <date month="" year="1994"/>
            </front>
            <seriesInfo name="ITU-T" value="Recommendation X.690"/>
         </reference>
         <reference anchor="RFC8941">
            <front>
               <title>Structured Field Values for HTTP</title>
               <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
               <author fullname="P-H. Kamp" initials="P-H." surname="Kamp"/>
               <date month="February" year="2021"/>
            </front>
            <seriesInfo name="RFC" value="8941"/>
            <seriesInfo name="DOI" value="10.17487/RFC8941"/>
         </reference>
      </references>
      <references title="Informative References">
         <reference anchor="RFC8446">
            <front>
               <title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
               <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
               <date month="August" year="2018"/>
            </front>
            <seriesInfo name="RFC" value="8446"/>
            <seriesInfo name="DOI" value="10.17487/RFC8446"/>
         </reference>
         <reference anchor="RFC5246">
            <front>
               <title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
               <author fullname="T. Dierks" initials="T." surname="Dierks"/>
               <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
               <date month="August" year="2008"/>
            </front>
            <seriesInfo name="RFC" value="5246"/>
            <seriesInfo name="DOI" value="10.17487/RFC5246"/>
         </reference>
         <reference anchor="RFC7540">
            <front>
               <title>Hypertext Transfer Protocol Version 2 (HTTP/2)</title>
               <author fullname="M. Belshe" initials="M." surname="Belshe"/>
               <author fullname="R. Peon" initials="R." surname="Peon"/>
               <author fullname="M. Thomson"
                       initials="M."
                       role="editor"
                       surname="Thomson"/>
               <date month="May" year="2015"/>
            </front>
            <seriesInfo name="RFC" value="7540"/>
            <seriesInfo name="DOI" value="10.17487/RFC7540"/>
         </reference>
         <reference anchor="RFC8740">
            <front>
               <title>Using TLS 1.3 with HTTP/2</title>
               <author fullname="D. Benjamin" initials="D." surname="Benjamin"/>
               <date month="February" year="2020"/>
            </front>
            <seriesInfo name="RFC" value="8740"/>
            <seriesInfo name="DOI" value="10.17487/RFC8740"/>
         </reference>
         <reference anchor="RFC7230">
            <front>
               <title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
               <author fullname="R. Fielding"
                       initials="R."
                       role="editor"
                       surname="Fielding"/>
               <author fullname="J. Reschke"
                       initials="J."
                       role="editor"
                       surname="Reschke"/>
               <date month="June" year="2014"/>
            </front>
            <seriesInfo name="RFC" value="7230"/>
            <seriesInfo name="DOI" value="10.17487/RFC7230"/>
         </reference>
         <reference anchor="RFC7468">
            <front>
               <title>Textual Encodings of PKIX, PKCS, and CMS Structures</title>
               <author fullname="S. Josefsson" initials="S." surname="Josefsson"/>
               <author fullname="S. Leonard" initials="S." surname="Leonard"/>
               <date month="April" year="2015"/>
            </front>
            <seriesInfo name="RFC" value="7468"/>
            <seriesInfo name="DOI" value="10.17487/RFC7468"/>
         </reference>
         <reference anchor="RFC7541">
            <front>
               <title>HPACK: Header Compression for HTTP/2</title>
               <author fullname="R. Peon" initials="R." surname="Peon"/>
               <author fullname="H. Ruellan" initials="H." surname="Ruellan"/>
               <date month="May" year="2015"/>
            </front>
            <seriesInfo name="RFC" value="7541"/>
            <seriesInfo name="DOI" value="10.17487/RFC7541"/>
         </reference>
         <reference anchor="I-D.ietf-quic-qpack">
            <front>
               <title>QPACK: Header Compression for HTTP/3</title>
               <author fullname="Charles 'Buck' Krasic">
                  <organization>Netflix</organization>
               </author>
               <author fullname="Mike Bishop">
                  <organization>Akamai Technologies</organization>
               </author>
               <author fullname="Alan Frindell">
                  <organization>Facebook</organization>
               </author>
               <date day="2" month="February" year="2021"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-ietf-quic-qpack-21"/>
         </reference>
         <reference anchor="RFC6585">
            <front>
               <title>Additional HTTP Status Codes</title>
               <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
               <author fullname="R. Fielding" initials="R." surname="Fielding"/>
               <date month="April" year="2012"/>
            </front>
            <seriesInfo name="RFC" value="6585"/>
            <seriesInfo name="DOI" value="10.17487/RFC6585"/>
         </reference>
         <reference anchor="I-D.ietf-quic-http">
            <front>
               <title>Hypertext Transfer Protocol Version 3 (HTTP/3)</title>
               <author fullname="Mike Bishop">
                  <organization>Akamai</organization>
               </author>
               <date day="2" month="February" year="2021"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-ietf-quic-http-34"/>
         </reference>
         <reference anchor="I-D.ietf-httpbis-semantics">
            <front>
               <title>HTTP Semantics</title>
               <author fullname="Roy T. Fielding">
                  <organization>Adobe</organization>
               </author>
               <author fullname="Mark Nottingham">
                  <organization>Fastly</organization>
               </author>
               <author fullname="Julian Reschke">
                  <organization>greenbytes GmbH</organization>
               </author>
               <date day="12" month="September" year="2021"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-semantics-19"/>
            <x:source basename="draft-ietf-httpbis-semantics-19"
                      href="draft-ietf-httpbis-semantics-19.xml"/>
         </reference>
         <reference anchor="RFC7239">
            <front>
               <title>Forwarded HTTP Extension</title>
               <author fullname="A. Petersson" initials="A." surname="Petersson"/>
               <author fullname="M. Nilsson" initials="M." surname="Nilsson"/>
               <date month="June" year="2014"/>
            </front>
            <seriesInfo name="RFC" value="7239"/>
            <seriesInfo name="DOI" value="10.17487/RFC7239"/>
         </reference>
         <reference anchor="RFC8705">
            <front>
               <title>OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens</title>
               <author fullname="B. Campbell" initials="B." surname="Campbell"/>
               <author fullname="J. Bradley" initials="J." surname="Bradley"/>
               <author fullname="N. Sakimura" initials="N." surname="Sakimura"/>
               <author fullname="T. Lodderstedt" initials="T." surname="Lodderstedt"/>
               <date month="February" year="2020"/>
            </front>
            <seriesInfo name="RFC" value="8705"/>
            <seriesInfo name="DOI" value="10.17487/RFC8705"/>
         </reference>
      </references>
      <section anchor="example">
         <name>Example</name>
         <t>In a hypothetical example where a TLS client presents the client and intermediate certificate from <xref target="example-chain"/> when establishing a mutually-authenticated TLS connection with the TTRP, the proxy would send the <spanx style="verb">Client-Cert</spanx> field shown in {#example-header} to the backend. Note that line breaks and whitespace have been added to the field value in <xref target="example-header"/> for display and formatting purposes only.</t>
         <figure anchor="example-chain"
                 title="Certificate Chain (with client certificate first)">
            <artwork>
-----BEGIN CERTIFICATE-----
MIIBqDCCAU6gAwIBAgIBBzAKBggqhkjOPQQDAjA6MRswGQYDVQQKDBJMZXQncyBB
dXRoZW50aWNhdGUxGzAZBgNVBAMMEkxBIEludGVybWVkaWF0ZSBDQTAeFw0yMDAx
MTQyMjU1MzNaFw0yMTAxMjMyMjU1MzNaMA0xCzAJBgNVBAMMAkJDMFkwEwYHKoZI
zj0CAQYIKoZIzj0DAQcDQgAE8YnXXfaUgmnMtOXU/IncWalRhebrXmckC8vdgJ1p
5Be5F/3YC8OthxM4+k1M6aEAEFcGzkJiNy6J84y7uzo9M6NyMHAwCQYDVR0TBAIw
ADAfBgNVHSMEGDAWgBRm3WjLa38lbEYCuiCPct0ZaSED2DAOBgNVHQ8BAf8EBAMC
BsAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0RAQH/BBMwEYEPYmRjQGV4YW1w
bGUuY29tMAoGCCqGSM49BAMCA0gAMEUCIBHda/r1vaL6G3VliL4/Di6YK0Q6bMje
SkC3dFCOOB8TAiEAx/kHSB4urmiZ0NX5r5XarmPk0wmuydBVoU4hBVZ1yhk=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIB5jCCAYugAwIBAgIBFjAKBggqhkjOPQQDAjBWMQswCQYDVQQGEwJVUzEbMBkG
A1UECgwSTGV0J3MgQXV0aGVudGljYXRlMSowKAYDVQQDDCFMZXQncyBBdXRoZW50
aWNhdGUgUm9vdCBBdXRob3JpdHkwHhcNMjAwMTE0MjEzMjMwWhcNMzAwMTExMjEz
MjMwWjA6MRswGQYDVQQKDBJMZXQncyBBdXRoZW50aWNhdGUxGzAZBgNVBAMMEkxB
IEludGVybWVkaWF0ZSBDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJf+aA54
RC5pyLAR5yfXVYmNpgd+CGUTDp2KOGhc0gK91zxhHesEYkdXkpS2UN8Kati+yHtW
CV3kkhCngGyv7RqjZjBkMB0GA1UdDgQWBBRm3WjLa38lbEYCuiCPct0ZaSED2DAf
BgNVHSMEGDAWgBTEA2Q6eecKu9g9yb5glbkhhVINGDASBgNVHRMBAf8ECDAGAQH/
AgEAMA4GA1UdDwEB/wQEAwIBhjAKBggqhkjOPQQDAgNJADBGAiEA5pLvaFwRRkxo
mIAtDIwg9D7gC1xzxBl4r28EzmSO1pcCIQCJUShpSXO9HDIQMUgH69fNDEMHXD3R
RX5gP7kuu2KGMg==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIICBjCCAaygAwIBAgIJAKS0yiqKtlhoMAoGCCqGSM49BAMCMFYxCzAJBgNVBAYT
AlVTMRswGQYDVQQKDBJMZXQncyBBdXRoZW50aWNhdGUxKjAoBgNVBAMMIUxldCdz
IEF1dGhlbnRpY2F0ZSBSb290IEF1dGhvcml0eTAeFw0yMDAxMTQyMTI1NDVaFw00
MDAxMDkyMTI1NDVaMFYxCzAJBgNVBAYTAlVTMRswGQYDVQQKDBJMZXQncyBBdXRo
ZW50aWNhdGUxKjAoBgNVBAMMIUxldCdzIEF1dGhlbnRpY2F0ZSBSb290IEF1dGhv
cml0eTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFoaHU+Z5bPKmGzlYXtCf+E6
HYj62fORaHDOrt+yyh3H/rTcs7ynFfGn+gyFsrSP3Ez88rajv+U2NfD0o0uZ4Pmj
YzBhMB0GA1UdDgQWBBTEA2Q6eecKu9g9yb5glbkhhVINGDAfBgNVHSMEGDAWgBTE
A2Q6eecKu9g9yb5glbkhhVINGDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE
AwIBhjAKBggqhkjOPQQDAgNIADBFAiEAmAeg1ycKHriqHnaD4M/UDBpQRpkmdcRF
YGMg1Qyrkx4CIB4ivz3wQcQkGhcsUZ1SOImd/lq1Q0FLf09rGfLQPWDc
-----END CERTIFICATE-----
</artwork>
         </figure>
         <figure anchor="example-header"
                 title="Header Field in HTTP Request to Origin Server">
            <artwork>
Client-Cert: :MIIBqDCCAU6gAwIBAgIBBzAKBggqhkjOPQQDAjA6MRswGQYDVQQKDBJ
 MZXQncyBBdXRoZW50aWNhdGUxGzAZBgNVBAMMEkxBIEludGVybWVkaWF0ZSBDQTAeFw0
 yMDAxMTQyMjU1MzNaFw0yMTAxMjMyMjU1MzNaMA0xCzAJBgNVBAMMAkJDMFkwEwYHKoZ
 Izj0CAQYIKoZIzj0DAQcDQgAE8YnXXfaUgmnMtOXU/IncWalRhebrXmckC8vdgJ1p5Be
 5F/3YC8OthxM4+k1M6aEAEFcGzkJiNy6J84y7uzo9M6NyMHAwCQYDVR0TBAIwADAfBgN
 VHSMEGDAWgBRm3WjLa38lbEYCuiCPct0ZaSED2DAOBgNVHQ8BAf8EBAMCBsAwEwYDVR0
 lBAwwCgYIKwYBBQUHAwIwHQYDVR0RAQH/BBMwEYEPYmRjQGV4YW1wbGUuY29tMAoGCCq
 GSM49BAMCA0gAMEUCIBHda/r1vaL6G3VliL4/Di6YK0Q6bMjeSkC3dFCOOB8TAiEAx/k
 HSB4urmiZ0NX5r5XarmPk0wmuydBVoU4hBVZ1yhk=:
</artwork>
         </figure>
         <t>If the proxy were configured to also include the certificate chain, it would also include this header:</t>
         <figure anchor="example-chain-header"
                 title="Certificate Chain in HTTP Request to Origin Server">
            <artwork>
Client-Cert-Chain: :MIIB5jCCAYugAwIBAgIBFjAKBggqhkjOPQQDAjBWMQsw
 CQYDVQQGEwJVUzEbMBkGA1UECgwSTGV0J3MgQXV0aGVudGljYXRlMSowKAYDVQQ
 DDCFMZXQncyBBdXRoZW50aWNhdGUgUm9vdCBBdXRob3JpdHkwHhcNMjAwMTE0Mj
 EzMjMwWhcNMzAwMTExMjEzMjMwWjA6MRswGQYDVQQKDBJMZXQncyBBdXRoZW50a
 WNhdGUxGzAZBgNVBAMMEkxBIEludGVybWVkaWF0ZSBDQTBZMBMGByqGSM49AgEG
 CCqGSM49AwEHA0IABJf+aA54RC5pyLAR5yfXVYmNpgd+CGUTDp2KOGhc0gK91zx
 hHesEYkdXkpS2UN8Kati+yHtWCV3kkhCngGyv7RqjZjBkMB0GA1UdDgQWBBRm3W
 jLa38lbEYCuiCPct0ZaSED2DAfBgNVHSMEGDAWgBTEA2Q6eecKu9g9yb5glbkhh
 VINGDASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBhjAKBggqhkjO
 PQQDAgNJADBGAiEA5pLvaFwRRkxomIAtDIwg9D7gC1xzxBl4r28EzmSO1pcCIQC
 JUShpSXO9HDIQMUgH69fNDEMHXD3RRX5gP7kuu2KGMg==:, :MIICBjCCAaygAw
 IBAgIJAKS0yiqKtlhoMAoGCCqGSM49BAMCMFYxCzAJBgNVBAYTAlVTMRswGQYDV
 QQKDBJMZXQncyBBdXRoZW50aWNhdGUxKjAoBgNVBAMMIUxldCdzIEF1dGhlbnRp
 Y2F0ZSBSb290IEF1dGhvcml0eTAeFw0yMDAxMTQyMTI1NDVaFw00MDAxMDkyMTI
 1NDVaMFYxCzAJBgNVBAYTAlVTMRswGQYDVQQKDBJMZXQncyBBdXRoZW50aWNhdG
 UxKjAoBgNVBAMMIUxldCdzIEF1dGhlbnRpY2F0ZSBSb290IEF1dGhvcml0eTBZM
 BMGByqGSM49AgEGCCqGSM49AwEHA0IABFoaHU+Z5bPKmGzlYXtCf+E6HYj62fOR
 aHDOrt+yyh3H/rTcs7ynFfGn+gyFsrSP3Ez88rajv+U2NfD0o0uZ4PmjYzBhMB0
 GA1UdDgQWBBTEA2Q6eecKu9g9yb5glbkhhVINGDAfBgNVHSMEGDAWgBTEA2Q6ee
 cKu9g9yb5glbkhhVINGDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBh
 jAKBggqhkjOPQQDAgNIADBFAiEAmAeg1ycKHriqHnaD4M/UDBpQRpkmdcRFYGMg
 1Qyrkx4CIB4ivz3wQcQkGhcsUZ1SOImd/lq1Q0FLf09rGfLQPWDc:
</artwork>
         </figure>
      </section>
      <section anchor="considerations-considered">
         <name>Considerations Considered</name>
         <section anchor="field-injection">
            <name>Field Injection</name>
            <t>This draft requires that the TTRP sanitize the fields of the incoming request by removing or overwriting any existing instances of the <spanx style="verb">Client-Cert</spanx> and <spanx style="verb">Client-Cert-Chain</spanx> header fields before dispatching that request to the backend application. Otherwise, a client could inject its own values that would appear to the backend to have come from the TTRP. Although numerous other methods of detecting/preventing field injection are possible; such as the use of a unique secret value as part of the field name or value or the application of a signature, HMAC, or AEAD, there is no common general standardized mechanism. The potential problem of client field injection is not at all unique to the functionality of this draft, and it would therefore be inappropriate for this draft to define a one-off solution. In the absence of a generic standardized solution existing currently, stripping/sanitizing the fields is the de facto means of protecting against field injection in practice today. Sanitizing the fields is sufficient when properly implemented and is a normative requirement of <xref target="sec"/>.</t>
         </section>
         <section anchor="the-forwarded-http-extension">
            <name>The Forwarded HTTP Extension</name>
            <t>The <spanx style="verb">Forwarded</spanx> HTTP header field defined in <xref target="RFC7239"/> allows proxy components to disclose information lost in the proxying process. The TLS client certificate information of concern to this draft could have been communicated with an extension parameter to the <spanx style="verb">Forwarded</spanx> field; however, doing so would have had some disadvantages that this draft endeavored to avoid. The <spanx style="verb">Forwarded</spanx> field syntax allows for information about a full chain of proxied HTTP requests, whereas the <spanx style="verb">Client-Cert</spanx> and <spanx style="verb">Client-Cert-Chain</spanx> header fields of this document are concerned only with conveying information about the certificate presented by the originating client on the TLS connection to the TTRP (which appears as the server from that client's perspective) to backend applications. The multi-hop syntax of the <spanx style="verb">Forwarded</spanx> field is expressive but also more complicated, which would make processing it more cumbersome, and more importantly, make properly sanitizing its content as required by <xref target="sec"/> to prevent field injection considerably more difficult and error-prone. Thus, this draft opted for a flatter and more straightforward structure.</t>
         </section>
         <section anchor="the-whole-certificate-and-certificate-chain">
            <name>The Whole Certificate and Certificate Chain</name>
            <t>Different applications will have varying requirements about what information from the client certificate is needed, such as the subject and/or issuer distinguished name, subject alternative name(s), serial number, subject public key info, fingerprint, etc.. Furthermore, some applications, such as <xref target="RFC8705"/>, make use of the entire certificate. In order to accommodate the latter and ensure wide applicability by not trying to cherry-pick particular certificate information, this draft opted to pass the full encoded certificate as the value of the <spanx style="verb">Client-Cert</spanx> field.</t>
            <t>The handshake and validation of the client certificate (chain) of the mutually-authenticated TLS connection is performed by the TTRP. With the responsibility of certificate validation falling on the TTRP, the end-entity certificate is oftentimes sufficient for the needs of the origin server. The separate <spanx style="verb">Client-Cert-Chain</spanx> field can convey the certificate chain for deployments that require such information.</t>
         </section>
      </section>
      <section anchor="acknowledgements">
         <name>Acknowledgements</name>
         <t>The authors would like to thank the following individuals who've contributed in various ways ranging from just being generally supportive of bringing forth the draft to providing specific feedback or content:</t>
         <t>
            <list style="symbols">
               <t>Evan Anderson</t>
               <t>Annabelle Backman</t>
               <t>Alan Frindell</t>
               <t>Rory Hewitt</t>
               <t>Fredrik Jeansson</t>
               <t>Benjamin Kaduk</t>
               <t>Torsten Lodderstedt</t>
               <t>Kathleen Moriarty</t>
               <t>Mark Nottingham</t>
               <t>Erik Nygren</t>
               <t>Mike Ounsworth</t>
               <t>Matt Peterson</t>
               <t>Eric Rescorla</t>
               <t>Justin Richer</t>
               <t>Michael Richardson</t>
               <t>Joe Salowey</t>
               <t>Rich Salz</t>
               <t>Mohit Sethi</t>
               <t>Rifaat Shekh-Yusef</t>
               <t>Travis Spencer</t>
               <t>Nick Sullivan</t>
               <t>Martin Thomson</t>
               <t>Peter Wu</t>
               <t>Hans Zandbelt</t>
            </list>
         </t>
      </section>
      <section anchor="document-history">
         <name>Document History</name>
         <ul empty="true">
            <li>
               <t>To be removed by the RFC Editor before publication as an RFC</t>
            </li>
         </ul>
         <t>draft-ietf-httpbis-client-cert-field-01</t>
         <t>
            <list style="symbols">
               <t>Use RFC 8941 Structured Field Values for HTTP</t>
               <t>Introduce a separate header that can convey the certificate chain</t>
               <t>Add considerations on header compression and size</t>
               <t>Describe interaction with caching</t>
               <t>Fill out IANA Considerations with HTTP field name registrations</t>
               <t>Discuss renegotiation</t>
            </list>
         </t>
         <t>draft-ietf-httpbis-client-cert-field-00</t>
         <t>
            <list style="symbols">
               <t>Initial WG revision</t>
               <t>Mike Bishop added as co-editor</t>
            </list>
         </t>
         <t>draft-bdc-something-something-certificate-05</t>
         <t>
            <list style="symbols">
               <t>Change intended status of the draft to Informational</t>
               <t>Editorial updates and (hopefully) clarifications</t>
            </list>
         </t>
         <t>draft-bdc-something-something-certificate-04</t>
         <t>
            <list style="symbols">
               <t>Update reference from draft-ietf-oauth-mtls to RFC8705</t>
            </list>
         </t>
         <t>draft-bdc-something-something-certificate-03</t>
         <t>
            <list style="symbols">
               <t>Expanded further discussion notes to capture some of the feedback in and around the presentation of the draft in SECDISPATCH at IETF 107 and add those who've provided such feedback to the acknowledgements</t>
            </list>
         </t>
         <t>draft-bdc-something-something-certificate-02</t>
         <t>
            <list style="symbols">
               <t>Editorial tweaks + further discussion notes</t>
            </list>
         </t>
         <t>draft-bdc-something-something-certificate-01</t>
         <t>
            <list style="symbols">
               <t>Use the RFC v3 Format or die trying</t>
            </list>
         </t>
         <t>draft-bdc-something-something-certificate-00</t>
         <t>
            <list style="symbols">
               <t>Initial draft after a time constrained and rushed <eref target="https://datatracker.ietf.org/meeting/106/materials/slides-106-secdispatch-securing-protocols-between-proxies-and-backend-http-servers-00">secdispatch presentation</eref> at IETF 106 in Singapore with the recommendation to write up a draft (at the end of the <eref target="https://datatracker.ietf.org/meeting/106/materials/minutes-106-secdispatch">minutes</eref>) and some folks expressing interest despite the rather poor presentation</t>
            </list>
         </t>
      </section>
   </back>
</rfc>
