diff --git a/transport/cache.go b/transport/cache.go index 561c92c1..da22cdee 100644 --- a/transport/cache.go +++ b/transport/cache.go @@ -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 } diff --git a/transport/cache_test.go b/transport/cache_test.go index eb9624d7..81f428de 100644 --- a/transport/cache_test.go +++ b/transport/cache_test.go @@ -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},