Enable post-quantum TLS on Go (crypto/tls) (X25519MLKEM768)
Choose your server or platform. You get the version check, the configuration, and how to verify that browsers now negotiate X25519MLKEM768.
Which version do you run?
1. Check your version
Go (crypto/tls)
go version
grep '^go ' go.mod
2. Configure
Go (crypto/tls)
srv := &http.Server{
Addr: ":443",
TLSConfig: &tls.Config{
CurvePreferences: []tls.CurveID{
tls.X25519MLKEM768, tls.X25519, tls.CurveP256,
},
},
}
log.Fatal(srv.ListenAndServeTLS("cert.pem", "key.pem"))
An empty CurvePreferences already uses the defaults, which include X25519MLKEM768. Also look for GODEBUG=tlsmlkem=0 in Dockerfiles, systemd units and Kubernetes manifests: it turns the defaults off.
An explicit group or curve list copied from an old hardening guide silently removes the hybrid group. Delete it, or keep X25519MLKEM768 first as shown.
4. Verify
Go (crypto/tls)
c, err := tls.Dial("tcp", "example.com:443", &tls.Config{})
if err != nil { log.Fatal(err) }
fmt.Println(c.ConnectionState().CurveID) // X25519MLKEM768
After the change
Run a free check of your domain below. Grade A means TLS 1.3 with hybrid post-quantum key exchange. The result page can also check every subdomain listed in public certificate logs, so you can see which hosts still need the same change.