Enable X25519MLKEM768 Post-Quantum TLS in Go 1.24+
Finding / Symptom: Go services compiled on Go <= 1.23 or with hardcoded CurvePreferences{tls.X25519, tls.CurveP256} cannot negotiate ML-KEM.
Upgrade your toolchain to Go 1.24+ and include tls.X25519MLKEM768 first in tls.Config.CurvePreferences (or leave CurvePreferences nil).
Copy-Paste Configuration Fix
// Go >= 1.24 crypto/tls server configuration
tlsCfg := &tls.Config{
MinVersion: tls.VersionTLS13,
CurvePreferences: []tls.CurveID{
tls.X25519MLKEM768,
tls.X25519,
tls.CurveP384,
},
}
Verify Live
go version && npx quantafeed-pqc-scan scan .
Test your stack live: Open-Source CycloneDX 1.6 CBOM Generator
Frequently Asked Questions
- Does Go 1.24 enable X25519MLKEM768 by default?
- Yes — when CurvePreferences is unset (nil), Go 1.24+ negotiates X25519MLKEM768 automatically. Problems occur when legacy code hardcodes CurvePreferences.