Post-quantum cryptography for web teams: what to inventory first

Use a loopback TLS lab to measure CDN and origin key exchange separately, then inventory the signatures your application verifies.
Inventory connections and signed objects separately
On December 2, 2026, ONCD, NSA, and CISA urged faster adoption of post-quantum cryptography after AI companies shared findings involving some cryptographic systems. The agencies assessed that the recent advances did not pose an immediate and widespread threat to deployed cryptography.
In its December 2 response, the UK’s NCSC urged organizations with high-value data, critical systems, or complex technical dependencies to follow its existing migration timeline. It emphasized January 1, 2031 as the target for their highest-priority actions.
ML-KEM is a key-encapsulation mechanism. In the hybrid TLS group X25519MLKEM768, it contributes to establishing the shared secret alongside X25519.
ML-DSA is a digital signature algorithm. The key-exchange group and the peer’s authentication signature are separate facts.
A CDN that terminates HTTPS is a TLS server on the browser-facing connection and a TLS client on an HTTPS origin pull. The two connections can select different key-exchange groups. Cloudflare documents browser-facing and origin-facing support separately.
Imagine a Laravel app serving orders behind a CDN. The CDN holds the public TLS endpoint, a load balancer terminates origin HTTPS, an identity provider signs JWTs, and a payment provider authenticates inbound webhooks. A CDN cryptography change affects the connections it terminates. The identity provider, webhook verifier, and release pipeline keep their own cryptographic policies.
Reproduce the two negotiated groups
Run the downloadable tls_legs.py with Python 3 and OpenSSL 3.6.3. Pass --openssl followed by the path to the executable if the system openssl points to a different TLS library. The script generates short-lived test certificates in a temporary directory, listens on loopback, and stops its servers on exit. Each probe checks the server identity and verifies the certificate against the expected test certificate.
The edge profile allows the hybrid and classical groups. The origin profile initially permits only X25519. The fallback client offers both groups. The strict client offers only the hybrid group. The test also connects to the edge while checking the origin’s DNS identity and requires that handshake to fail.
In the lab, the edge profile negotiated X25519MLKEM768 with a hybrid-capable client and X25519 with a classical-only client. The origin profile negotiated X25519 when the client allowed fallback and rejected a hybrid-only connection. After the profile change, it negotiated X25519MLKEM768. Every successful case still used an RSA-PSS peer signature.
Read the negotiated group and peer signature fields separately. The ciphersuite field identifies the record-protection suite in TLS 1.3. A TLS_AES_256_GCM_SHA384 line alone does not establish that the connection used a hybrid key exchange or a post-quantum certificate.
The lab exposes two independent loopback TLS listeners. It does not forward HTTP traffic, run Laravel, or test a Cloudflare account. It checks full TLS 1.3 handshakes with OpenSSL 3.6.3, which is narrower than proving how every browser, QUIC connection, or cached origin connection behaves.
"""Loopback-only TLS profile checks. Requires OpenSSL 3.6.3 and Python 3."""
import argparse
from contextlib import contextmanager
from pathlib import Path
import re
import socket
import subprocess
import tempfile
import time
HYBRID = "X25519MLKEM768"
CLASSICAL = "X25519"
def run(*args, check=True):
return subprocess.run(
[OPENSSL, *args], input="", text=True, capture_output=True,
timeout=8, check=check,
)
@contextmanager
def endpoint(directory, name, groups):
cert = str(directory / f"{name}.crt")
key = str(directory / f"{name}.key")
run("req", "-x509", "-newkey", "rsa:2048", "-noenc", "-days", "1",
"-subj", f"/CN={name}", "-addext", f"subjectAltName=DNS:{name}",
"-keyout", key, "-out", cert)
with socket.socket() as reservation:
reservation.bind(("127.0.0.1", 0))
port = reservation.getsockname()[1]
server = subprocess.Popen(
[OPENSSL, "s_server", "-accept", f"127.0.0.1:{port}", "-tls1_3",
"-cert", cert, "-key", key, "-groups", groups, "-www", "-quiet"],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
)
try:
until = time.monotonic() + 5
while True:
if server.poll() is not None or time.monotonic() >= until:
raise RuntimeError(f"{name}: TLS server did not start")
try:
with socket.create_connection(("127.0.0.1", port), timeout=0.1):
break
except OSError:
time.sleep(0.05)
yield port, name, cert
finally:
if server.poll() is None:
server.terminate()
try:
server.wait(timeout=2)
except subprocess.TimeoutExpired:
server.kill()
server.wait()
def probe(endpoint, offered, hostname=None):
port, name, cert = endpoint
result = run("s_client", "-connect", f"127.0.0.1:{port}",
"-servername", name, "-verify_hostname", hostname or name,
"-CAfile", cert, "-verify_return_error", "-tls1_3",
"-groups", offered, "-brief", check=False)
return result.returncode, result.stdout + result.stderr
def expect_group(label, endpoint, offered, expected):
status, transcript = probe(endpoint, offered)
group = re.search(r"(?:Negotiated TLS1\.3 group|Peer Temp Key):\s*([^\s,]+)", transcript)
if status or not group or group[1] != expected or "Verification: OK" not in transcript:
raise RuntimeError(f"{label}: expected verified {expected}\n{transcript}")
if not re.search(r"^Signature type: rsa_pss_rsae_sha256\s*$", transcript, re.MULTILINE):
raise RuntimeError(f"{label}: expected RSA-PSS peer handshake signature\n{transcript}")
print(f"{label}: {expected}, RSA-PSS peer signature")
def expect_failure(label, target, groups, reason, *, hostname=None):
status, transcript = probe(target, groups, hostname)
if not status or reason not in transcript.lower():
raise RuntimeError(f"{label}: expected {reason}\n{transcript}")
print(f"{label}: handshake rejected")
def main():
with tempfile.TemporaryDirectory(prefix="tls-legs-") as directory:
path = Path(directory)
with endpoint(path, "edge.test", f"{HYBRID}:{CLASSICAL}") as edge:
expect_group("edge hybrid", edge, HYBRID, HYBRID)
expect_group("edge classical client", edge, CLASSICAL, CLASSICAL)
expect_failure("wrong origin identity", edge, HYBRID, "hostname mismatch",
hostname="origin.test")
with endpoint(path, "origin.test", CLASSICAL) as origin:
expect_group("origin fallback", origin, f"{HYBRID}:{CLASSICAL}", CLASSICAL)
expect_failure("origin hybrid only", origin, HYBRID, "handshake failure")
with endpoint(path, "origin.test", f"{HYBRID}:{CLASSICAL}") as origin:
expect_group("origin after profile change", origin, HYBRID, HYBRID)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--openssl", default="openssl", help="OpenSSL executable")
OPENSSL = parser.parse_args().openssl
print(run("version").stdout.split(" (Library:", 1)[0].strip())
main()
Prove the CDN-to-origin connection in staging
For a real Laravel deployment, start with the network diagram and put a measurement at both TLS terminators. A direct probe of an approved origin endpoint proves what that test client negotiated under its own policy. To verify the actual CDN-to-origin connection, use the origin terminator’s handshake logs or trace an authorized test request at that terminator.
Send a cache-bypassing request to a staging path that the origin serves, then correlate its request ID with the origin log and the TLS connection that carried it. Account for connection reuse. If the origin sees a pooled connection, trace where that connection was established or repeat on a newly established connection. A cache hit can leave you with no origin request to inspect.
For a controlled direct probe, use OpenSSL s_client with the origin address, the intended SNI and verification hostname, the correct CA file when a private CA is used, and verification errors treated as failures. Test a compatible offer and a hybrid-only offer. If the origin requires mutual TLS, use an authorized test client identity. Keep the existing origin access restrictions in place.
Cloudflare’s hybrid requirement applies to outbound TLS 1.3 connections across the zone, including Workers fetch requests. A destination that lacks the required group can return a 525 handshake error. The requirement leaves TLS 1.2 connections outside its scope. Test in a separate staging zone. Include every origin and Worker destination before changing production, record the previous requirement for rollback, and repeat the probes after a TLS configuration change.
Put application signatures in the same inventory
For a JWT, record the issuer, verification library, allowed algorithms, key IDs, verifier rollout order, and longest token lifetime. Pin the accepted algorithms in the verifier’s configuration instead of letting the token select the policy.
For a payment webhook that uses HMAC-SHA-256, record the exact input bytes, key owner, secret rotation procedure, accepted replay window, and which retries may still carry an old signature. HMAC is symmetric message authentication. ML-DSA is a public-key signature scheme, so a change here starts with the provider’s protocol and key-management support.
For a deploy artifact, identify the signer, the verification policy, and every enforcement point, such as a deployment controller or admission policy. Test that an older approved release can still be verified during rollback and that a signature made with an unauthorized key is rejected. Include the artifact digest in your evidence so the result applies to a particular build.
The downloadable inventory separates the two TLS connections from three signed or authenticated objects. For each row, record who owns rotation, how you know which algorithm was used, which consumers must accept it, and how long compatibility needs to last. Add any database TLS, service-to-service TLS, backup keys, or signed URLs that your actual application uses.
Reproduce the examples
The loopback TLS lab, expected output, and a sample Laravel cryptography inventory in CSV.
Download the source and tests (.zip)
