Skip to content

Commit 176b8b3

Browse files
ramnbtmjuraga
authored andcommitted
MEDIUM: 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 standard library defaults: on go >= 1.24 these prefer a hybrid post-quantum key exchange and automatically adopt new groups as the toolchain updates. Note: hybrid key exchange exists only in TLS 1.3; connections negotiating TLS 1.2 (permitted by the current MinVersion) remain classical.
1 parent 44dc08c commit 176b8b3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎server.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ func (s *Server) Serve() (err error) {
222222

223223
// Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go
224224
httpsServer.TLSConfig = &tls.Config{
225-
// Only use curves which have assembly implementations
226-
// https://github.com/golang/go/tree/master/src/crypto/elliptic
227-
CurvePreferences: []tls.CurveID{tls.CurveP256},
225+
// CurvePreferences left nil: Go >= 1.24 defaults prefer the
226+
// post-quantum hybrid X25519MLKEM768 and auto-adopt new groups
227+
// as the toolchain updates.
228228
// Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
229229
NextProtos: []string{"h2", "http/1.1"},
230230
// https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols

0 commit comments

Comments
 (0)