Test util AssertTLS supports both old and new goboring

- Current goboring only allows TLS 1.2.
- The next goboring will allow TLS 1.2 and TLS 1.3. We got a preview
  of this when the Go team upgraded goboring in Go 1.21.6, but then
  downgraded it again in the next Go releases.
This commit is contained in:
Ryan Richard
2024-02-08 09:39:01 -08:00
parent c47bc74ad0
commit e303a45dd1

View File

@@ -85,6 +85,10 @@ func AssertTLS(t *testing.T, r *http.Request, clientTLSConfigFunc ptls.ConfigFun
var wantClientSupportedCiphers []uint16
switch {
// When the provided config only supports TLS 1.2, then set up the expected values for TLS 1.2.
case clientTLSConfig.MinVersion == tls.VersionTLS12 && clientTLSConfig.MaxVersion == tls.VersionTLS12:
wantClientSupportedVersions = []uint16{tls.VersionTLS12}
wantClientSupportedCiphers = clientTLSConfig.CipherSuites
// When the provided config only supports TLS 1.3, then set up the expected values for TLS 1.3.
case clientTLSConfig.MinVersion == tls.VersionTLS13:
wantClientSupportedVersions = []uint16{tls.VersionTLS13}