How I Made My Next.js Site Post-Quantum Ready, and Tested Every Service It Uses
Hands-on guide · Security · December 2026
Short answer: my Next.js site on Cloudflare already negotiates the post-quantum key exchange X25519MLKEM768, and so do 11 of the 12 hosts it talks to. The one that doesn't is api.github.com. I wrote a short Node.js script that proves this, and a CI job that fails the build if my site ever drops it.
Video: the wider AI news this week, from the Detroon Shah channel. Watch it on YouTube if the player does not load.
Key facts
- Site tested
- zubairhussain.xyz, a Next.js app on Cloudflare Workers (OpenNext)
- Key exchange negotiated
- X25519MLKEM768 (X25519 + ML-KEM-768, NIST FIPS 203), TLS 1.3
- Certificate
- ECDSA P-256 from Google Trust Services, still classical
- Dependencies tested
- 12 hosts; 11 support ML-KEM, api.github.com does not
- Enforcement
- GitHub Actions job using Node.js 24 (OpenSSL 3.5), fails if the site loses ML-KEM
- Git
- SSH to GitHub negotiates mlkem768x25519-sha256 (OpenSSH 10.6); HTTPS to github.com is classical
- Tested on
- 4 December 2026
Why I did this now
On 2 December 2026, Amazon, Anthropic, Apple, Cloudflare, Google, Microsoft, OpenAI and Oracle published a two-sentence joint statement. They back the US government's guidance to move to NIST's post-quantum algorithms and to do it as soon as possible. The same day, the NSA, CISA and the Office of the National Cyber Director said recent AI-driven research affects some cryptography in use today, while adding that it is not an immediate, widespread threat.
A day later, Cloudflare moved its own deadline to be fully post-quantum from 2029 to 2027.
The statement names no algorithm and no deadline. It tells you to move and leaves the how to you. I build websites for clients, so I started with my own: what in this stack is post-quantum today, what isn't, and how do I stop it going backwards?
What "post-quantum ready" means for a web app
Every HTTPS connection does two jobs. The key exchange agrees the secret that encrypts the session. The certificate proves you reached the real server.
Key exchange is the urgent half. Someone can record your encrypted traffic now and decrypt it later, once a large quantum computer exists. That is "harvest now, decrypt later". X25519MLKEM768 runs the classical X25519 exchange and ML-KEM-768 (NIST FIPS 203) together, so an attacker would have to break both.
Certificates matter only while a connection is happening, so a forged one needs a quantum computer that already exists. No browser or certificate authority issues post-quantum certificates yet. That half waits on the industry.
Step 1: List every hop your data takes
My portfolio is a Next.js app deployed to Cloudflare Workers with OpenNext. I went through next.config.mjs (the CSP connect-src list is a ready-made inventory) and the API routes, and wrote down every connection.
| Hop | Example in my stack | Who controls the crypto |
|---|---|---|
| Visitor to site | Browser to zubairhussain.xyz | Cloudflare edge |
| Server to APIs | Contact form to Turnstile, chat to GitHub API | The API provider |
| Browser to services | Firebase, EmailJS, analytics | The service provider |
| Developer to repo | git push to GitHub | My SSH client and GitHub |
| App code | Signing, hashing, tokens | Me |
The last row was the pleasant surprise. My code has no hand-written cryptography: the only call is crypto.randomUUID() for chat session IDs, which quantum computers don't affect. Spam checks go through Cloudflare Turnstile and sign-in through Firebase. So the job was testing, not rewriting.
Step 2: Test your own site with one command
You need OpenSSL 3.5 or newer, the first release with ML-KEM. Offer only the hybrid group and see if the server accepts it:
openssl s_client -connect zubairhussain.xyz:443 \
-servername zubairhussain.xyz -groups X25519MLKEM768 </dev/null 2>/dev/null \
| grep -E "Negotiated|Peer signature"
My result:
Peer signature type: ecdsa_secp256r1_sha256
Negotiated TLS1.3 group: X25519MLKEM768
The first line is the certificate (classical). The second is the key exchange (post-quantum). If the server doesn't support the group, you get a handshake failure alert instead. On Cloudflare this works on every plan with no setting to change.
Step 3: Test every service you depend on
Your site is only as private as its weakest hop. I wrote check-pq-tls.mjs, a Node.js script with no dependencies that opens a TLS 1.3 connection to each host offering only X25519MLKEM768 and records what happens.
Twelve of thirteen passed, including both Google Firebase endpoints, EmailJS, Cloudinary and the two Vercel apps behind my live chat and booking page. api.github.com refused it. My AI chat route calls that API to list my repositories, so that one hop is still classical. The data is public repository names, so the risk is low, and I've noted it to retest.
Three things showed up that a dashboard would never tell you:
- Certificates vary by provider: Google and Cloudflare serve ECDSA P-256, while Vercel and Cloudinary serve RSA 2048. Both are classical.
- Two hosts in my CSP no longer resolve at all (
api-inference.huggingface.coand the barefirebaseio.com). That is CSP clean-up for another day. - github.com over HTTPS is classical too, which matters for the next step.
Step 4: Make CI fail if it ever breaks
A test you run once is a screenshot. I added the script to my existing GitHub Actions security workflow, which runs on every pull request and once a week:
post-quantum:
name: Post-quantum TLS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24 # bundles OpenSSL 3.5 (ML-KEM)
- run: node .github/scripts/check-pq-tls.mjs
My two hosts are required: if either stops negotiating X25519MLKEM768, after a DNS move or a CDN change, the job fails. Third-party hosts are report-only because I can't fix their servers, but the table lands in the job summary every week, so I'll see the day GitHub turns it on.
Step 5: Check your SSH and git connections
Your source code travels too. OpenSSH 10 uses the hybrid mlkem768x25519-sha256 exchange by default. Check what your client supports and what GitHub negotiates:
ssh -V
ssh -Q kex | grep mlkem
ssh -vT git@github.com 2>&1 | grep "kex: algorithm"
Mine shows OpenSSH 10.6 and kex: algorithm: mlkem768x25519-sha256. Since github.com over HTTPS is still classical, pushing over SSH is currently the post-quantum way to reach GitHub. If your remote starts with https://, switch it with git remote set-url origin git@github.com:user/repo.git.
What I couldn't fix
- Certificates. Mine is ECDSA P-256 from Google Trust Services. Cloudflare plans post-quantum Merkle Tree Certificates from early 2027, and I'll switch when they're available.
- api.github.com. Classical until GitHub enables ML-KEM. My check will show the day it does.
- Hops I can't see. Connections Cloudflare makes from my Worker to other servers happen inside Cloudflare. My script tests the destinations, not Cloudflare's client, so I can't confirm those hops end to end.
Checklist for your own site
- Run the OpenSSL command above against your domain and every subdomain.
- Turn your CSP
connect-srcand server-side fetch calls into a host list. - Test each host, and replace providers that won't support ML-KEM on your roadmap.
- Put the check in CI: required for your hosts, report-only for vendors.
- Update OpenSSH to version 10 and push over SSH.
- Set a reminder for early 2027, when post-quantum certificates should arrive.
Frequently asked questions
How do I check if my website uses post-quantum TLS?
Run openssl s_client -connect yoursite.com:443 -groups X25519MLKEM768 with OpenSSL 3.5 or newer. If the output shows "Negotiated TLS1.3 group: X25519MLKEM768", the key exchange is post-quantum. In Chrome you can also open DevTools, go to the Security tab and read the key exchange under Connection.
Is my Next.js app post-quantum if it runs on Cloudflare?
The connection between visitors and Cloudflare is, for any browser that offers ML-KEM. My test shows zubairhussain.xyz negotiating X25519MLKEM768. Calls your server code makes to other APIs depend on those APIs: in my stack 11 of 12 support it and api.github.com does not.
Do I need to change my Next.js code?
Usually no. My app has no hand-written cryptography: Turnstile, Firebase and the browser handle it. The work is checking each hop, choosing providers that support ML-KEM and adding a test so it stays that way.
Are my TLS certificates post-quantum?
Not yet, and nobody's are. My certificate uses ECDSA P-256. Certificates only need to resist a quantum computer that exists at the moment someone attacks the connection, so key exchange comes first. Cloudflare plans to issue post-quantum Merkle Tree Certificates in early 2027.
What is harvest now, decrypt later?
An attacker records encrypted traffic today and stores it until a quantum computer can break the classical key exchange. Data that must stay secret for years, such as health records or private messages, is at risk even before that computer exists. Post-quantum key exchange closes that gap.
Machine-readable summary (JSON for AI assistants and tools)
{
"type": "hands-on-guide",
"title": "How I Made My Next.js Site Post-Quantum Ready, and Tested Every Service It Uses",
"url": "https://zubairhussain.xyz/blogs/post-quantum-tls-nextjs-cloudflare",
"author": {
"name": "Zubair Hussain",
"role": "Full-stack developer",
"site": "https://zubairhussain.xyz"
},
"testedOn": "2026-12-04",
"context": {
"event": "Joint statement on transition to post-quantum cryptography",
"date": "2026-12-02",
"signatories": [
"Amazon",
"Anthropic",
"Apple",
"Cloudflare",
"Google",
"Microsoft",
"OpenAI",
"Oracle"
],
"cloudflareTarget": {
"before": 2029,
"after": 2027
}
},
"site": {
"host": "zubairhussain.xyz",
"stack": [
"Next.js",
"Cloudflare Workers",
"OpenNext"
],
"keyExchange": "X25519MLKEM768",
"certificate": "ECDSA P-256",
"postQuantumKeyExchange": true
},
"dependencies": [
{
"host": "challenges.cloudflare.com",
"role": "Turnstile spam check",
"mlkem": true
},
{
"host": "zubair-xovato.blogspot.com",
"role": "Blogger (articles)",
"mlkem": true
},
{
"host": "firestore.googleapis.com",
"role": "Firebase database",
"mlkem": true
},
{
"host": "identitytoolkit.googleapis.com",
"role": "Firebase sign-in",
"mlkem": true
},
{
"host": "api.emailjs.com",
"role": "contact form email",
"mlkem": true
},
{
"host": "script.google.com",
"role": "Apps Script form",
"mlkem": true
},
{
"host": "zubair-agent.vercel.app",
"role": "live chat backend",
"mlkem": true
},
{
"host": "calendly-booking-navy.vercel.app",
"role": "booking page",
"mlkem": true
},
{
"host": "res.cloudinary.com",
"role": "video hosting",
"mlkem": true
},
{
"host": "www.google-analytics.com",
"role": "analytics",
"mlkem": true
},
{
"host": "api.github.com",
"role": "AI chat (repo list)",
"mlkem": false
}
],
"enforcement": {
"tool": "GitHub Actions",
"script": ".github/scripts/check-pq-tls.mjs",
"node": 24,
"openssl": "3.5",
"failsOn": "site not negotiating X25519MLKEM768"
},
"howToCheck": "openssl s_client -connect HOST:443 -groups X25519MLKEM768",
"notYetPossible": [
"post-quantum certificates",
"ML-KEM on api.github.com"
]
}
Sources
- Anthropic: Joint statement on transition to post-quantum cryptography (2 Dec 2026)
- OpenAI: the same joint statement
- Cloudflare: Project Quantum Leap, fully post-quantum in 2027
- Cloudflare: Post-quantum cryptography is still safe
- Fortune: report on the statement and the NSA, CISA and ONCD advisory
- NIST FIPS 203: ML-KEM standard
- My check script on GitHub
Share this guide
If it saved you an afternoon, send it to the person who looks after your company's website.