From e6b35b836a86ca1564ba514ffa352c074558c09b Mon Sep 17 00:00:00 2001 From: ramnbt Date: Sat, 21 Nov 2026 19:25:20 -0600 Subject: [PATCH] tls: enable post-quantum key exchange via default curve preferences Remove the CurvePreferences pin (dating from the era when only assembly-backed curves were recommended) so the server rides the Go stdlib defaults: on go >= 1.24 these prefer the hybrid post-quantum X25519MLKEM768 key exchange and automatically adopt new groups as the toolchain updates (go 1.26 added SecP256r1MLKEM768 and SecP384r1MLKEM1024). Note: hybrid key exchange exists only in TLS 1.3; connections negotiating TLS 1.2 (permitted by the current MinVersion) remain classical. Co-Authored-By: Claude Fable 5 --- server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.go b/server.go index 5c2cca50..f926af8c 100644 --- a/server.go +++ b/server.go @@ -222,9 +222,9 @@ func (s *Server) Serve() (err error) { // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go httpsServer.TLSConfig = &tls.Config{ - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, + // CurvePreferences left nil: Go >= 1.24 defaults prefer the + // post-quantum hybrid X25519MLKEM768 and auto-adopt new groups + // as the toolchain updates. // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility NextProtos: []string{"h2", "http/1.1"}, // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols