TLS                                                           A. Ghedini
Internet-Draft                                          Cloudflare, Inc.
Intended status: Standards Track                             V. Vasiliev
Expires: October 25, 2018                                         Google April 23, 6, 2019                                            Google
                                                        October 03, 2018

         Transport Layer Security (TLS)

                      TLS Certificate Compression


   In Transport Layer Security (TLS) 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 Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering

   time.  It is inappropriate to use Internet-Drafts as reference

   This Internet-Draft will expire on October 25, 2018. April 6, 2019.

Copyright Notice

   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   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
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents


1.  Introduction

   In order to reduce latency and improve performance it can be useful
   to reduce the amount of data exchanged during a Transport Layer
   Security (TLS) TLS handshake.

   avoid transmitting certificates already shared in an earlier
   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 full handshakes.

2.  Notational Conventions

   capitals, as shown here.

3.  Negotiating Certificate Compression

   or earlier is negotiated, the peers MUST ignore this extension.

   This document defines a new extension type
   compression formats for the Certificate message to the peer.
   Whenever it is sent by the client as a ClientHello message extension ([I-D.ietf-tls-tls13],
   server certificates.  Whenever it is sent by the server as a
   CertificateRequest extension ([I-D.ietf-tls-tls13], ([RFC8446], Section 4.3.2), it indicates
   the 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 {
       } CertificateCompressionAlgorithm;

       struct {
           CertificateCompressionAlgorithm algorithms<1..2^8-1>;
       } CertificateCompressionAlgorithms;

   There is no ServerHello extension that the server is required to echo

4.  Compressed Certificate Message

   If 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;
       } 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"

   compressed_certificate_message  The compressed body of the
      Certificate message, in the same format as it would normally be
      expressed in.  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 [RFC1950].  If the specified compression algorithm is
   brotli, the Certificate message MUST be compressed with the Brotli
   compression algorithm as defined in [RFC7932].

   If the received CompressedCertificate message cannot be decompressed,
   the connection MUST be torn down with the "bad_certificate" alert.

   If the format of the Certificate message is altered using the
   server_certificate_type or client_certificate_type extensions
   [RFC7250], the resulting altered message is compressed instead.

5.  Security Considerations

   After decompression, the Certificate message MUST be processed as if
   the verification have the same security properties as they would have
   in TLS normally.

   Since certificate chains are typically presented on a per-server name
   or per-user basis, the attacker does not have control over any
   individual fragments in the Certificate message, meaning that they
   cannot leak information about the certificate by modifying the

   The implementations SHOULD bound the memory usage when decompressing
   the CompressedCertificate message.

   The implementations MUST limit the size of the resulting decompressed
   chain to the specified uncompressed length, and they MUST abort the
   connection if the size exceeds that limit.  TLS framing imposes
   16777216 byte limit on the certificate message size, and the

6.  Middlebox Compatibility

   It'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 [I-D.ietf-tls-tls13] [RFC8446] and higher.

7.  IANA Considerations

7.1.  Update of the TLS ExtensionType Registry

   Create an entry, compress_certificate(TBD), compress_certificate(27), in the existing registry
   for ExtensionType (defined in [I-D.ietf-tls-tls13]), [RFC8446]), with "TLS 1.3" column
   values being set to "CH, CR". CR", and "Recommended" column being set to

7.2.  Update of the TLS HandshakeType Registry

   Create an entry, compressed_certificate(TBD), compressed_certificate(25), in the existing registry
   for HandshakeType (defined in [RFC5246]). [RFC8446]).

7.3.  Registry for Compression Algorithms

   This document establishes a registry of compression algorithms
   supported for compressing the Certificate message, titled
   "Certificate Compression Algorithm IDs", under the existing
   "Transport Layer Security (TLS) Extensions" heading.

   The entries in the registry are:

           | Algorithm Number | Description                   |
           | 0                | Reserved                      |
           |                  |                               |
           | 1                | zlib                          |
           |                  |                               |
           | 2                | brotli                        |
           |                  |                               |
           | 16384 to 65535   | Reserved for Experimental Use |

   policy for values strictly smaller than 256, under "Specification
   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 [I-D.ietf-tls-iana-registry-updates]. [RFC8447].

8.  Normative References

              and DTLS", draft-ietf-tls-iana-registry-updates-04 (work
              in progress), February 2018.

              March 2018.

              Specification version 3.3", RFC 1950,
              DOI 10.17487/RFC1950, May 1996,

              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,

              (TLS) Protocol Version 1.2", RFC 5246,
              DOI 10.17487/RFC5246, August 2008,

              Transport Layer Security (TLS) and Datagram Transport
              June 2014, <https://www.rfc-editor.org/info/rfc7250>.

              (TLS) Cached Information Extension", RFC 7924,
              DOI 10.17487/RFC7924, July 2016,


              Writing an IANA Considerations Section in RFCs", BCP 26,
              RFC 8126, DOI 10.17487/RFC8126, June 2017,




Appendix A.  Acknowledgements

   Certificate compression was originally introduced in the QUIC Crypto
   protocol, designed by Adam Langley and Wan-Teh Chang.

   This document has benefited from contributions and suggestions from
   Swett, Martin Thomson, Sean Turner and many others.

Authors' Addresses

   Alessandro Ghedini
   Cloudflare, Inc.

   Email: alessandro@cloudflare.com

   Victor Vasiliev

   Email: vasilvv@google.com