mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Plumb cipher/tls version serving options
This commit is contained in:
parent
f657607d88
commit
e156aca4f2
@ -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