All Articles
10 min

How I Made My Next.js Site Post-Quantum Ready, and Tested Every Service It Uses

Most RecentTrendingSecurity

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.

HANDS-ON GUIDE · DECEMBER 2026 I made my Next.js site post-quantum ready and tested every service it talks to. Tested on zubairhussain.xyz with OpenSSL 3.5 and Node.js 24. Key exchange: X25519MLKEM768. Enforced in CI. zubairhussain.xyz · Zubair Hussain, full-stack developer
What I found when I audited my own site.

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.

WHAT "POST-QUANTUM READY" COVERS TODAY 1. Key exchange Agrees the secret that encrypts every byte of the session. X25519MLKEM768 classical X25519 + ML-KEM-768 Stops harvest-now, decrypt-later. ✓ DONE ON MY SITE 2. Certificate Proves the server is really zubairhussain.xyz. ECDSA P-256 issued by Google Trust Services Only matters once a quantum computer exists. … WAITING ON PQ CERTIFICATES Measured with openssl s_client and Node.js 24 (OpenSSL 3.5) on 4 December 2026.
Key exchange is solved today. Certificates are next.

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.

HopExample in my stackWho controls the crypto
Visitor to siteBrowser to zubairhussain.xyzCloudflare edge
Server to APIsContact form to Turnstile, chat to GitHub APIThe API provider
Browser to servicesFirebase, EmailJS, analyticsThe service provider
Developer to repogit push to GitHubMy SSH client and GitHub
App codeSigning, hashing, tokensMe

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.

post-quantum TLS check $ node .github/scripts/check-pq-tls.mjs ✓ zubairhussain.xyz X25519MLKEM768 ✓ www.zubairhussain.xyz X25519MLKEM768 ✓ challenges.cloudflare.com X25519MLKEM768 ✓ zubair-xovato.blogspot.com X25519MLKEM768 ✓ firestore.googleapis.com X25519MLKEM768 ✓ identitytoolkit.googleapis.com X25519MLKEM768 ✓ api.emailjs.com X25519MLKEM768 ✓ script.google.com X25519MLKEM768 ✓ zubair-agent.vercel.app X25519MLKEM768 ✓ calendly-booking-navy.vercel.app X25519MLKEM768 ✓ res.cloudinary.com X25519MLKEM768 ✓ www.google-analytics.com X25519MLKEM768 ✗ api.github.com classical only required hosts passed · exit 0
The check script running against my site and every service it uses.
I TESTED EVERY HOST MY SITE TALKS TO zubairhussain.xyzmy site (Cloudflare)ML-KEM ✓ www.zubairhussain.xyzredirect hostML-KEM ✓ challenges.cloudflare.comTurnstile spam checkML-KEM ✓ zubair-xovato.blogspot.comBlogger (articles)ML-KEM ✓ firestore.googleapis.comFirebase databaseML-KEM ✓ identitytoolkit.googleapis.comFirebase sign-inML-KEM ✓ api.emailjs.comcontact form emailML-KEM ✓ script.google.comApps Script formML-KEM ✓ zubair-agent.vercel.applive chat backendML-KEM ✓ calendly-booking-navy.vercel.appbooking pageML-KEM ✓ res.cloudinary.comvideo hostingML-KEM ✓ www.google-analytics.comanalyticsML-KEM ✓ api.github.comAI chat (repo list)classical ✗ Script: .github/scripts/check-pq-tls.mjs · run 4 Dec 2026
Real results, 4 December 2026.

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.co and the bare firebaseio.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
HOW CI KEEPS IT THAT WAY Pull requestor weekly cron Node.js 24OpenSSL 3.5 HandshakeML-KEM only Pass / failsummary table Required: zubairhussain.xyz and www (fails the build) Report-only: 11 third-party services (shows the gaps)
My own hosts are required. Third-party hosts are report-only.

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

  1. Run the OpenSSL command above against your domain and every subdomain.
  2. Turn your CSP connect-src and server-side fetch calls into a host list.
  3. Test each host, and replace providers that won't support ML-KEM on your roadmap.
  4. Put the check in CI: required for your hosts, report-only for vendors.
  5. Update OpenSSH to version 10 and push over SSH.
  6. 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

Share this guide

If it saved you an afternoon, send it to the person who looks after your company's website.

Work with me

Zubair Hussain is a full-stack developer in Hyderabad, Pakistan. He builds Next.js websites, React Native apps and AI chatbots for clients worldwide, with security checks like this one in the CI pipeline from day one. See his work on LinkedIn.

Want this audit on your own site? I'll test every hop, fix what can be fixed and set up the CI check, then send you the report.

Book a free call Web development LinkedIn Portfolio