Skip to content

Commit 49b8b4b

Browse files
wangke19openshift-cherrypick-robot
authored andcommitted
Improve TLS 1.2 constraint comment for cipher suite testing
Update the comment explaining why cipher suite tests are constrained to TLS 1.2 to be more technically accurate. The previous comment suggested this was about "Go 1.23+ behavior", but the real issue is fundamental to how TLS 1.3 works: - The intermediate profile allows both TLS 1.2 and TLS 1.3 - Clients negotiate TLS 1.3 when MaxVersion is unspecified and server supports it - TLS 1.3 spec predefines cipher suites and doesn't support configuration - Therefore, specifying any cipher suite has no effect with TLS 1.3 - Forcing TLS 1.2 allows actual testing of cipher suite restrictions This makes the reasoning clearer for future maintainers.
1 parent ba45918 commit 49b8b4b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/extended/apiserver/tls.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,11 @@ var _ = g.Describe("[sig-api-machinery][Feature:APIServer]", func() {
165165
return err
166166
}
167167
expectFailure := !defaultCiphers[cipher]
168-
// Constrain to TLS 1.2 to prevent Go 1.23+ from silently ignoring
169-
// deprecated ciphers and falling back to TLS 1.3 with secure defaults
168+
// Constrain to TLS 1.2 because the intermediate profile allows both TLS 1.2 and TLS 1.3.
169+
// If MaxVersion is unspecified, the client negotiates TLS 1.3 when the server supports it.
170+
// TLS 1.3 does not support configuring cipher suites (predetermined by the spec), so
171+
// specifying any cipher suite (RC4 or otherwise) has no effect with TLS 1.3.
172+
// By forcing TLS 1.2, we can actually test the cipher suite restrictions.
170173
cfg := &tls.Config{
171174
CipherSuites: []uint16{cipher},
172175
MinVersion: tls.VersionTLS12,

0 commit comments

Comments
 (0)