How to enable post-quantum TLS on Go (crypto/tls)
Checked · Official docs
On by default since Go 1.24 unless CurvePreferences is set or GODEBUG=tlsmlkem=0.
When Go (crypto/tls) faces the internet directly, it negotiates TLS with every visitor, so the change belongs in its TLS configuration. If a CDN or load balancer sits in front, fix that first: it is what visitors connect to. The hybrid falls back to classical X25519 for clients that don't support it, so turning it on doesn't break older browsers.
Turn on post-quantum key exchange
Build with Go 1.24 or newer. If you set CurvePreferences, include the hybrid first:
&tls.Config{
MinVersion: tls.VersionTLS12,
CurvePreferences: []tls.CurveID{tls.X25519MLKEM768, tls.X25519, tls.CurveP256},
}Turn off TLS 1.0 and 1.1
Set MinVersion:
MinVersion: tls.VersionTLS12,
Check that it worked
After you deploy, rescan your domain. A quantum-safe setup shows X25519MLKEM768 as the negotiated key exchange. From a terminal:
curl qsafe.sh/your-domain.com?fresh
Prefer to let an AI agent make the change? The qsafe-fix skill and the MCP server use this same guide. It's also available as JSON from /api/v1/fixes/go.