Skip to content

Commit bf4b04b

Browse files
author
Kubernetes Submit Queue
authoredMar 29, 2017
Merge pull request #42337 from liggitt/tls-config
Automatic merge from submit-queue (batch tested with PRs 38741, 41301, 43645, 43779, 42337) Plumb cipher/tls version serving options Needed to allow servers to harden or relax default tls versions and ciphers
2 parents fad2753 + e156aca commit bf4b04b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
 

‎staging/src/k8s.io/apiserver/pkg/server/config.go

+8
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ type SecureServingInfo struct {
185185

186186
// ClientCA is the certificate bundle for all the signers that you'll recognize for incoming client certificates
187187
ClientCA *x509.CertPool
188+
189+
// MinTLSVersion optionally overrides the minimum TLS version supported.
190+
// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
191+
MinTLSVersion uint16
192+
193+
// CipherSuites optionally overrides the list of allowed cipher suites for the server.
194+
// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
195+
CipherSuites []uint16
188196
}
189197

190198
// NewConfig returns a Config struct with the default values

‎staging/src/k8s.io/apiserver/pkg/server/serve.go

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ func (s *GenericAPIServer) serveSecurely(stopCh <-chan struct{}) error {
5656
},
5757
}
5858

59+
if s.SecureServingInfo.MinTLSVersion > 0 {
60+
secureServer.TLSConfig.MinVersion = s.SecureServingInfo.MinTLSVersion
61+
}
62+
if len(s.SecureServingInfo.CipherSuites) > 0 {
63+
secureServer.TLSConfig.CipherSuites = s.SecureServingInfo.CipherSuites
64+
}
65+
5966
if s.SecureServingInfo.Cert != nil {
6067
secureServer.TLSConfig.Certificates = []tls.Certificate{*s.SecureServingInfo.Cert}
6168
}

0 commit comments

Comments
 (0)