X3DH is a key agreement protocol that establishes shared secret keys between two parties using asynchronous cryptography, enabling offline messaging and forward secrecy. The protocol involves Alice, Bob, and a server, using elliptic curve Diffie-Hellman functions with X25519 or X448 curves for mutual authentication and encrypted communication.
Cloudflare introduced Automatic Key Exchange, which probes origin servers to learn their preferred TLS 1.3 key agreement algorithms instead of always guessing X25519. This reduced HelloRetryRequests from 52% to 3.7% and cut handshake latency by over 150ms at p90, while automatically enabling post-quantum hybrid connections (X25519MLKEM768) for hundreds of thousands of domains without manual configuration.