mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
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
This commit is contained in:
commit
bf4b04b192
@ -185,6 +185,14 @@ type SecureServingInfo struct {
|
||||
|
||||
// ClientCA is the certificate bundle for all the signers that you'll recognize for incoming client certificates
|
||||
ClientCA *x509.CertPool
|
||||
|
||||
// MinTLSVersion optionally overrides the minimum TLS version supported.
|
||||
// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
|
||||
MinTLSVersion uint16
|
||||
|
||||
// CipherSuites optionally overrides the list of allowed cipher suites for the server.
|
||||
// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
|
||||
CipherSuites []uint16
|
||||
}
|
||||
|
||||
// NewConfig returns a Config struct with the default values
|
||||
|
@ -56,6 +56,13 @@ func (s *GenericAPIServer) serveSecurely(stopCh <-chan struct{}) error {
|
||||
},
|
||||
}
|
||||
|
||||
if s.SecureServingInfo.MinTLSVersion > 0 {
|
||||
secureServer.TLSConfig.MinVersion = s.SecureServingInfo.MinTLSVersion
|
||||
}
|
||||
if len(s.SecureServingInfo.CipherSuites) > 0 {
|
||||
secureServer.TLSConfig.CipherSuites = s.SecureServingInfo.CipherSuites
|
||||
}
|
||||
|
||||
if s.SecureServingInfo.Cert != nil {
|
||||
secureServer.TLSConfig.Certificates = []tls.Certificate{*s.SecureServingInfo.Cert}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user