mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-27 07:28:14 +00:00
Include ServerName in tls transport cache key
Kubernetes-commit: 195a4d6f6da77ec39c5f80f3906406583c143996
This commit is contained in:
parent
b59eb049cd
commit
fdf7e51f22
@ -88,5 +88,5 @@ func tlsConfigKey(c *Config) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
// Only include the things that actually affect the tls.Config
|
||||
return fmt.Sprintf("%v/%x/%x/%x", c.TLS.Insecure, c.TLS.CAData, c.TLS.CertData, c.TLS.KeyData), nil
|
||||
return fmt.Sprintf("%v/%x/%x/%x/%v", c.TLS.Insecure, c.TLS.CAData, c.TLS.CertData, c.TLS.KeyData, c.TLS.ServerName), nil
|
||||
}
|
||||
|
@ -62,6 +62,20 @@ func TestTLSConfigKey(t *testing.T) {
|
||||
KeyData: []byte{1},
|
||||
},
|
||||
},
|
||||
"cert 1, key 1, servername 1": {
|
||||
TLS: TLSConfig{
|
||||
CertData: []byte{1},
|
||||
KeyData: []byte{1},
|
||||
ServerName: "1",
|
||||
},
|
||||
},
|
||||
"cert 1, key 1, servername 2": {
|
||||
TLS: TLSConfig{
|
||||
CertData: []byte{1},
|
||||
KeyData: []byte{1},
|
||||
ServerName: "2",
|
||||
},
|
||||
},
|
||||
"cert 1, key 2": {
|
||||
TLS: TLSConfig{
|
||||
CertData: []byte{1},
|
||||
|
Loading…
Reference in New Issue
Block a user