Skip to content

Commit 7808b91

Browse files
committed
tlsconfig: remove uses of PreferServerCipherSuites
This field was deprecated in [go1.17beta1], and is no longer used, so we can remove its use, as the minimum go version in go.mod is go1.18. [go1.17beta1]: golang/go@9d0819b Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 1401877 commit 7808b91

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

tlsconfig/config.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ var DefaultServerAcceptedCiphers = append(clientCipherSuites, acceptedCBCCiphers
5353
func ServerDefault(ops ...func(*tls.Config)) *tls.Config {
5454
tlsConfig := &tls.Config{
5555
// Avoid fallback by default to SSL protocols < TLS1.2
56-
MinVersion: tls.VersionTLS12,
57-
PreferServerCipherSuites: true,
58-
CipherSuites: DefaultServerAcceptedCiphers,
56+
MinVersion: tls.VersionTLS12,
57+
CipherSuites: DefaultServerAcceptedCiphers,
5958
}
6059

6160
for _, op := range ops {

tlsconfig/config_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ func TestConfigServerTLSServerCertsOnly(t *testing.T) {
127127
if !reflect.DeepEqual(tlsConfig.CipherSuites, DefaultServerAcceptedCiphers) {
128128
t.Fatal("Unexpected server cipher suites")
129129
}
130-
if !tlsConfig.PreferServerCipherSuites { //nolint:staticcheck // Ignore SA1019: tlsConfig.PreferServerCipherSuites has been deprecated since Go 1.18: PreferServerCipherSuites is ignored.
131-
t.Fatal("Expected server to prefer cipher suites")
132-
}
133130
if tlsConfig.MinVersion != tls.VersionTLS12 {
134131
t.Fatal("Unexpected server TLS version")
135132
}

0 commit comments

Comments
 (0)