]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: have servers prefer TLS 1.3 when supported
authorDaniel McCarney <daniel@binaryparadox.net>
Thu, 15 May 2025 17:41:14 +0000 (13:41 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 21 May 2025 19:17:01 +0000 (12:17 -0700)
commita21b71daf57a54a12c2aedff0fba0860fa977590
tree7a3c34843f27ee5626291b2a37643af2d38ca4f9
parentc5a1fc1f97b4b6b384a9852d96a77868e0f5e6a9
crypto/tls: have servers prefer TLS 1.3 when supported

Previously the common Config.mutualVersion() code prioritized the
selected version based on the provided peerVersions being sent in peer
preference order.

Instead we would prefer to see TLS 1.3 used whenever it is
supported, even if the peer would prefer an older protocol version.
This commit updates mutualVersions() to implement this policy change.

Our new behaviour matches the behaviour of other TLS stacks, notably
BoringSSL, and so also allows enabling the IgnoreClientVersionOrder BoGo
test that we otherwise must skip.

Updates #72006

Change-Id: I27a2cd231e4b8762b0d9e2dbd3d8ddd5b87fd5cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/673236
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
TryBot-Bypass: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
doc/next/6-stdlib/99-minor/crypto/tls/version_pref.md [new file with mode: 0644]
src/crypto/tls/bogo_config.json
src/crypto/tls/common.go