mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-04-15 07:06:45 +00:00
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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user