This document designates the following headers, defined further in Sections [
2.2] and [
2.3], respectively, to carry the client certificate information of a mutually authenticated TLS connection. The headers convey the information from the reverse proxy to the origin server.
-
Client-Cert:
-
The end-entity certificate used by the client in the TLS handshake with the reverse proxy.
-
Client-Cert-Chain:
-
The certificate chain used for validation of the end-entity certificate provided by the client in the TLS handshake with the reverse proxy.
The headers in this document encode certificates as Byte Sequences (
Section 3.3.5 of [
STRUCTURED-FIELDS]) where the value of the binary data is a DER-encoded [
ITU.X690] X.509 certificate [
RFC 5280]. 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.
Note that certificates are often stored in an encoded textual format, such as the one described in
Section 5.1 of
RFC 7468, which is already nearly compatible with a Byte Sequence. If certificates are encoded as such, it will be sufficient to replace "---(BEGIN|END) CERTIFICATE---" with ":" and remove line breaks in order to generate an appropriate item.
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.
Client-Cert is a Byte Sequence with the value of the header encoded as described in
Section 2.1.
The Client-Cert header field is only for use in HTTP requests and
MUST NOT be used in HTTP responses. It is a singleton header field value as defined in
Section 5.5 of [
HTTP], which
MUST NOT have a list of values or occur multiple times in a request.
Figure 2 in
Appendix A has an example of the Client-Cert header field.
In the context of a TLS terminating reverse proxy deployment, the proxy
MAY make the certificate chain available to the backend application with the Client-Cert-Chain HTTP header field.
Client-Cert-Chain is a List (
Section 3.1 of [
STRUCTURED-FIELDS]). Each item in the List
MUST be a Byte Sequence encoded as described in
Section 2.1. The order is the same as the ordering in TLS (as described in
Section 4.4.2 of [
TLS]).
Client-Cert-Chain
MUST NOT appear unless Client-Cert is also present, and it does not itself include the end-entity certificate that is already present in Client-Cert. The root certificate
MAY be omitted from Client-Cert-Chain, provided that the target origin server is known to possess the omitted trust anchor.
The Client-Cert-Chain header field is only for use in HTTP requests and
MUST NOT be used in HTTP responses. It
MAY 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.
Figure 3 in
Appendix A has an example of the Client-Cert-Chain header field.
This section outlines the applicable processing rules for a TTRP that has negotiated a mutually authenticated TLS connection to convey the client certificate from that connection to the backend origin servers. This technique is to be used as a configuration or deployment option, and the processing rules described herein are for servers operating with that option enabled.
A TTRP negotiates the use of a mutually authenticated TLS connection with the client, such as is described in [
TLS] or [
TLS1.2], and validates the client certificate per its policy and trusted certificate authorities. Each HTTP request on the underlying TLS connection is dispatched to the origin server with the following modifications:
-
The client certificate is placed in the Client-Cert header field of the dispatched request, as described in Section 2.2.
-
If so configured, the validation chain of the client certificate is placed in the Client-Cert-Chain header field of the request, as described in Section 2.3.
-
Any occurrence of the Client-Cert or Client-Cert-Chain header fields in the original incoming request MUST be removed or overwritten before forwarding the request. An incoming request that has a Client-Cert or Client-Cert-Chain header field MAY be rejected with an HTTP 400 response.
Requests to the TTRP made over a TLS connection where the use of client certificate authentication was not negotiated
MUST be sanitized by removing any and all occurrences of the Client-Cert and Client-Cert-Chain header fields prior to dispatching the request to the backend server.
Backend origin servers may then use the Client-Cert 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. Access control decisions based on the client certificate (or lack thereof) can be conveyed by selecting response content as appropriate or with an HTTP 403 response, if the certificate is deemed unacceptable for the given context. Note that TLS clients that rely on error indications at the TLS layer for an unacceptable certificate will not receive those signals.
When the value of the Client-Cert request header field is used to select a response (e.g., the response content is access-controlled), the response
MUST either be uncacheable (e.g., by sending Cache-Control: no-store) or be designated for selective reuse only for subsequent requests with the same Client-Cert header field value by sending a "Vary: Client-Cert" response header. If a TTRP encounters a response with Client-Cert or Client-Cert-Chain in the Vary header field (
Section 12.5.5 of [
HTTP]), it
SHOULD prevent the user agent from caching the response by transforming the value of the Vary response header field to "*".
Forward proxies and other intermediaries
MUST NOT add the Client-Cert or Client-Cert-Chain header fields to requests or modify an existing Client-Cert or Client-Cert-Chain header field. Similarly, clients
MUST NOT employ the Client-Cert or Client-Cert-Chain header field in requests.