TLS Certificate CompressionCloudflare, Inc.alessandro@cloudflare.comGooglevasilvv@google.com
Security
TLSIn TLS handshakes, certificate chains often take up
the majority of the bytes transmitted.This document describes how certificate chains can be compressed to reduce the
amount of data transmitted and avoid some round trips.Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by
the Internet Engineering Steering Group (IESG). Further
information on Internet Standards is available in Section 2 of
RFC 7841.
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
.
Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
() in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with
respect to this document. Code Components extracted from this
document must include Simplified BSD License text as described in
Section 4.e of the Trust Legal Provisions and are provided without
warranty as described in the Simplified BSD License.
Table of Contents
. Introduction
. Notational Conventions
. Negotiating Certificate Compression
. Compressed Certificate Message
. Security Considerations
. Middlebox Compatibility
. IANA Considerations
. TLS ExtensionType Values
. TLS HandshakeType
. Compression Algorithms
. References
. Normative References
. Informative References
Acknowledgements
Authors' Addresses
IntroductionIn order to reduce latency and improve performance, it can be useful to reduce
the amount of data exchanged during a TLS handshake. describes a mechanism that allows a client and a server to avoid
transmitting certificates already shared in an earlier handshake, but it
doesn't help when the client connects to a server for the first time and
doesn't already have knowledge of the server's certificate chain.This document describes a mechanism that would allow certificates to be
compressed during all handshakes.Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
"MAY", and "OPTIONAL" in this document are to be interpreted as
described in BCP 14
when, and only when, they appear in all capitals, as shown here.
Negotiating Certificate CompressionThis extension is only supported with TLS 1.3 and newer; if TLS 1.2
or earlier is negotiated, the peers MUST ignore this extension.This document defines a new extension type (compress_certificate(27)), which
can be used to signal the supported compression formats for the Certificate
message to the peer. Whenever it is sent by the client as a ClientHello message
extension (), it indicates support for
compressed server certificates. Whenever it is sent by the server as a
CertificateRequest extension (), it indicates support for compressed client certificates.By sending a compress_certificate extension, the sender indicates to the peer
the certificate-compression algorithms it is willing to use for decompression.
The "extension_data" field of this extension SHALL contain a
CertificateCompressionAlgorithms value:
enum {
zlib(1),
brotli(2),
zstd(3),
(65535)
} CertificateCompressionAlgorithm;
struct {
CertificateCompressionAlgorithm algorithms<2..2^8-2>;
} CertificateCompressionAlgorithms;
The compress_certificate extension is a unidirectional indication; no
corresponding response extension is needed.Compressed Certificate MessageIf the peer has indicated that it supports compression, server and
client MAY
compress their corresponding Certificate messages ()
and send them in the form of the CompressedCertificate message (replacing the
Certificate message).The CompressedCertificate message is formed as follows:
struct {
CertificateCompressionAlgorithm algorithm;
uint24 uncompressed_length;
opaque compressed_certificate_message<1..2^24-1>;
} CompressedCertificate;
algorithm:
The algorithm used to compress the certificate. The algorithm
MUST be one of
the algorithms listed in the peer's compress_certificate extension.
uncompressed_length:
The length of the Certificate message once it is uncompressed. If, after
decompression, the specified length does not match the actual length, the
party receiving the invalid message MUST abort the connection with the
"bad_certificate" alert. The presence of this field allows the receiver to
preallocate the buffer for the uncompressed Certificate message and enforce
limits on the message size before performing decompression.
compressed_certificate_message:
The result of applying the indicated compression algorithm to the encoded
Certificate message that would have been sent if certificate compression was not
in use. The compression algorithm defines how the
bytes in the compressed_certificate_message field are converted into the
Certificate message.
If the specified compression algorithm is zlib, then the Certificate message
MUST be compressed with the ZLIB compression algorithm, as defined in .
If the specified compression algorithm is brotli, the Certificate message MUST
be compressed with the Brotli compression algorithm, as defined in . If
the specified compression algorithm is zstd, the Certificate message MUST be
compressed with the Zstandard compression algorithm, as defined in .It is possible to define a certificate compression algorithm that uses a
preshared dictionary to achieve a higher compression ratio. This document does
not define any such algorithms, but additional codepoints may be allocated for
such use per the policy in .If the received CompressedCertificate message cannot be decompressed, the
connection MUST be terminated with the "bad_certificate" alert.If the format of the Certificate message is altered using the
server_certificate_type or client_certificate_type extensions , the
resulting altered message is compressed instead.Security ConsiderationsAfter decompression, the Certificate message MUST be processed as if it were
encoded without being compressed. This way, the parsing and the verification
have the same security properties as they would have in TLS normally.In order for certificate compression to function correctly, the underlying
compression algorithm MUST output the same data
that was provided as input by the peer.Since certificate chains are typically presented on a per-server-name or
per-user basis, a malicious application does not have control over any individual fragments
in the Certificate message, meaning that they cannot leak information about the
certificate by modifying the plaintext.Implementations SHOULD bound the memory usage when decompressing the
CompressedCertificate message.Implementations MUST limit the size of the resulting decompressed chain to
the specified uncompressed length, and they MUST abort the connection if the
size of the output of the decompression function exceeds that limit. TLS framing
imposes a 16777216-byte limit on the certificate message size, and implementations
MAY impose a limit that is lower than that; in both cases, they MUST apply the same
limit as if no compression were used.While the Certificate message in TLS 1.3 is encrypted, third parties can draw
inferences from the message length observed on the wire. TLS 1.3 provides a padding
mechanism (discussed in Sections and of ) to counteract such
analysis. Certificate compression alters the length of the Certificate message,
and the change in length is dependent on the actual contents of the certificate.
Any padding scheme covering the Certificate message has to address compression
within its design or disable it altogether.Middlebox CompatibilityIt's been observed that a significant number of middleboxes intercept and try
to validate the Certificate message exchanged during a TLS handshake. This
means that middleboxes that don't understand the CompressedCertificate message
might misbehave and drop connections that adopt certificate compression.
Because of that, the extension is only supported in the versions of TLS where
the certificate message is encrypted in a way that prevents middleboxes from
intercepting it -- that is, TLS version 1.3 and higher.IANA ConsiderationsTLS ExtensionType ValuesIANA has created an entry, compress_certificate(27), in the
"TLS ExtensionType Values" registry (defined in ) with the values in the "TLS 1.3" column
set to "CH, CR" and the "Recommended" column entry set to "Yes".TLS HandshakeTypeIANA has created an entry, compressed_certificate(25), in
the "TLS Handshake Type" registry (defined in ), with the "DTLS-OK" column value set to
"Yes".Compression AlgorithmsThis document establishes a registry of compression algorithms supported for
compressing the Certificate message, titled "TLS Certificate Compression Algorithm
IDs", under the existing "Transport Layer Security (TLS) Extensions" registry.The entries in the registry are:
TLS Certificate Compression Algorithm IDs
Algorithm Number
Description
Reference
0
Reserved
RFC 8879
1
zlib
RFC 8879
2
brotli
RFC 8879
3
zstd
RFC 8879
16384 to 65535
Reserved for Experimental Use
The values in this registry shall be allocated under "IETF Review" policy for
values strictly smaller than 256, under "Specification Required" policy for
values 256-16383, and under "Experimental Use" otherwise (see for the
definition of relevant policies). Experimental Use extensions can be used both
on private networks and over the open Internet.The procedures for requesting values in the Specification Required space are
specified in .ReferencesNormative ReferencesZLIB Compressed Data Format Specification version 3.3This specification defines a lossless compressed data format. This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind.Key words for use in RFCs to Indicate Requirement LevelsIn many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.Using Raw Public Keys in Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)This document specifies a new certificate type and two TLS extensions for exchanging raw public keys in Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS). The new certificate type allows raw public keys to be used for authentication.Transport Layer Security (TLS) Cached Information ExtensionTransport Layer Security (TLS) handshakes often include fairly static information, such as the server certificate and a list of trusted certification authorities (CAs). This information can be of considerable size, particularly if the server certificate is bundled with a complete certificate chain (i.e., the certificates of intermediate CAs up to the root CA).This document defines an extension that allows a TLS client to inform a server of cached information, thereby enabling the server to omit already available information.Brotli Compressed Data FormatThis specification defines a lossless compressed data format that compresses data using a combination of the LZ77 algorithm and Huffman coding, with efficiency comparable to the best currently available general-purpose compression methods.Guidelines for Writing an IANA Considerations Section in RFCsMany protocols make use of points of extensibility that use constants to identify various protocol parameters. To ensure that the values in these fields do not have conflicting uses and to promote interoperability, their allocations are often coordinated by a central record keeper. For IETF protocols, that role is filled by the Internet Assigned Numbers Authority (IANA).To make assignments in a given registry prudently, guidance describing the conditions under which new values should be assigned, as well as when and how modifications to existing values can be made, is needed. This document defines a framework for the documentation of these guidelines by specification authors, in order to assure that the provided guidance for the IANA Considerations is clear and addresses the various issues that are likely in the operation of a registry.This is the third edition of this document; it obsoletes RFC 5226.Ambiguity of Uppercase vs Lowercase in RFC 2119 Key WordsRFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.The Transport Layer Security (TLS) Protocol Version 1.3This document specifies version 1.3 of the Transport Layer Security (TLS) protocol. TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077, 5246, and 6961. This document also specifies new requirements for TLS 1.2 implementations.IANA Registry Updates for TLS and DTLSThis document describes a number of changes to TLS and DTLS IANA registries that range from adding notes to the registry all the way to changing the registration policy. These changes were mostly motivated by WG review of the TLS- and DTLS-related registries undertaken as part of the TLS 1.3 development process.This document updates the following RFCs: 3749, 5077, 4680, 5246, 5705, 5878, 6520, and 7301.Zstandard Compression and the application/zstd Media TypeZstandard, or "zstd" (pronounced "zee standard"), is a data compression mechanism. This document describes the mechanism and registers a media type and content encoding to be used when transporting zstd-compressed content via Multipurpose Internet Mail Extensions (MIME).Despite use of the word "standard" as part of its name, readers are advised that this document is not an Internet Standards Track specification; it is being published for informational purposes only.Informative ReferencesThe Transport Layer Security (TLS) Protocol Version 1.2This document specifies Version 1.2 of the Transport Layer Security (TLS) protocol. The TLS protocol provides communications security over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery. [STANDARDS-TRACK]AcknowledgementsCertificate compression was originally introduced in the QUIC Crypto protocol,
designed by and .This document has benefited from contributions and suggestions from , , , , , , , , , and many others.Authors' AddressesCloudflare, Inc.alessandro@cloudflare.comGooglevasilvv@google.com