shiichan

Cloudflare's Automatic Key Exchange Makes TLS Handshakes to Your Origin Blazing Fast!

Hi there, I'm Shiichan! Today I found an update that quietly speeds up traffic behind the scenes, so let me tell you about it.

Cloudflare Changelog developers.cloudflare.com

What was announced?

The Cloudflare Changelog announced Automatic key exchange, a feature that automatically makes TLS 1.3 handshakes between Cloudflare and your origin servers faster and more secure.

The story so far

In a TLS 1.3 handshake, the client (Cloudflare, in this case) sends a key share in its first ClientHello message. But the client doesn't know ahead of time which key agreement algorithm the origin prefers. If it sends an algorithm the origin doesn't support, the origin responds with a HelloRetryRequest, which adds one extra network round trip. It's subtle, but it was quietly slowing things down.

What changes

Automatic key exchange continuously scans and learns what your origin supports, so it can predict the right key share and send it from the very first ClientHello. That avoids the HelloRetryRequest and saves one round trip.

When an origin supports both classical and post-quantum key agreements, Cloudflare now prefers the X25519MLKEM768 post-quantum hybrid key agreement.

This is already turned on for all existing zones, and it's on by default for new zones too, so you get the benefit without changing any settings.

Dive Deep

You can manage this from SSL/TLS > Overview > Origin connection & post-quantum encryption.

  • Turning off Automatic key exchange stops the automatic scans and preference updates (turning it off does not change your compliance requirements)
  • Post-quantum hybrid — requires the origin to support hybrid post-quantum key agreements
  • FIPS — requires FIPS-compliant key agreements
  • Select both to require a key agreement that satisfies both, or leave both unselected to allow all supported key agreements

It's also worth noting that compliance requirements apply only to TLS 1.3 connections. For the full requirements and configuration details, check out Automatic key exchange to origins.

Wrap-up

  • Cloudflare announced Automatic key exchange, which automatically optimizes TLS 1.3 handshakes with your origin
  • It continuously scans and learns your origin's supported algorithms, sending the right key share in the first ClientHello to avoid a HelloRetryRequest and save one round trip
  • It's already on for existing zones and on by default for new ones; when an origin supports both classical and post-quantum agreements, the X25519MLKEM768 hybrid is preferred
  • You can require Post-quantum hybrid or FIPS, or turn the feature off entirely, from SSL/TLS > Overview > Origin connection & post-quantum encryption

This update is great for anyone running an origin behind Cloudflare who cares about TLS handshake speed and compliance settings!