Skip to content

Commit 84e2b94

Browse files
committed
tls: Don't fail on min-tls-version 1.3 and specified ciphers.
Blocking when both minimal TLS version is 1.3 and ciphers are specified may break upgrade path on clusters that use such settings (e.g.: Openshift cluster using TLSSecurityProfile type Custom, min TLS version 1.3 and ciphers). Drop the configurable ciphers validation. Add comment in 'tls-cipher-suites' flag description about how cipher-suites are affected by 'min-tls-version'. Signed-off-by: Or Mergi <ormergi@redhat.com>
1 parent 320cf55 commit 84e2b94

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

cmd/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ func main() {
8888
"Supported values are tls package constants names (e.g. VersionTLS13), please see "+
8989
"https://pkg.go.dev/crypto/tls#pkg-constants")
9090
flag.StringVar(&tlsCipherSuitesRaw, "tls-cipher-suites", "",
91-
"Comma-separated list of TLS cipher suite names (OpenSSL names. E.g: TLS_AES_128_GCM_SHA256).")
91+
"Comma-separated list of TLS cipher suite names (OpenSSL names. E.g: TLS_AES_128_GCM_SHA256)."+
92+
"When 'min-tls-version' is 'VersionTLS13', cipher suites are selected by the runtime.")
9293
flag.StringVar(&tlsCurvePreferencesRaw, "tls-curve-preferences", "",
9394
"Comma-separated list of TLS curve preference names. "+
9495
"Supported values are tls package constants names (e.g. CurveP256), please see "+

pkg/config/tls.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ func ParseTLSOptions(
6868
}
6969

7070
cipherSuiteNames := parseStringSlice(tlsCipherSuitesRaw)
71-
if err := validateTLSVersionConfigurableCiphers(tlsMinVersion, cipherSuiteNames); err != nil {
72-
return nil, err
73-
}
7471
cipherSuiteIDs, err := toCipherSuiteIDs(cipherSuiteNames)
7572
if err != nil {
7673
return nil, err
@@ -107,13 +104,6 @@ func toTLSVersion(tlsVersionName string) (uint16, error) {
107104
return tlsVersion, nil
108105
}
109106

110-
func validateTLSVersionConfigurableCiphers(versionID uint16, cipherSuiteNames []string) error {
111-
if versionID == tls.VersionTLS13 && len(cipherSuiteNames) > 0 {
112-
return fmt.Errorf("configuring cipher suites for TLS 1.3 is not allowed")
113-
}
114-
return nil
115-
}
116-
117107
func toCipherSuiteIDs(cipherSuiteNames []string) ([]uint16, error) {
118108
ids, err := getValuesByKeys(tlsCipherSuiteIDByName, cipherSuiteNames)
119109
if err != nil {

pkg/config/tls_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ var _ = Describe("ParseTLSOptions", func() {
6565
ciphers: "TLS_AES_128_GCM_SHA256",
6666
},
6767
),
68-
Entry("cipher suites are specified and minimal version is 1.3",
69-
flags{
70-
minVersion: "VersionTLS13",
71-
ciphers: "TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384",
72-
},
73-
),
7468
)
7569

7670
DescribeTable("should succeed, given",

0 commit comments

Comments
 (0)