agent: ensure the TLS hostname verification knows about the currently configured domain (#5513)

This commit is contained in:
R.B. Boyer 2019-03-19 16:35:19 -05:00 committed by Hans Hasselberg
parent b2a70cb80e
commit 02b2cb1d15
2 changed files with 3 additions and 0 deletions

View File

@ -1592,6 +1592,7 @@ func (c *RuntimeConfig) ToTLSUtilConfig() tlsutil.Config {
CertFile: c.CertFile, CertFile: c.CertFile,
KeyFile: c.KeyFile, KeyFile: c.KeyFile,
NodeName: c.NodeName, NodeName: c.NodeName,
Domain: c.DNSDomain,
ServerName: c.ServerName, ServerName: c.ServerName,
TLSMinVersion: c.TLSMinVersion, TLSMinVersion: c.TLSMinVersion,
CipherSuites: c.TLSCipherSuites, CipherSuites: c.TLSCipherSuites,

View File

@ -5441,6 +5441,7 @@ func TestRuntime_ToTLSUtilConfig(t *testing.T) {
KeyFile: "d", KeyFile: "d",
NodeName: "e", NodeName: "e",
ServerName: "f", ServerName: "f",
DNSDomain: "g",
TLSMinVersion: "tls12", TLSMinVersion: "tls12",
TLSCipherSuites: []uint16{tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305}, TLSCipherSuites: []uint16{tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305},
TLSPreferServerCipherSuites: true, TLSPreferServerCipherSuites: true,
@ -5458,6 +5459,7 @@ func TestRuntime_ToTLSUtilConfig(t *testing.T) {
require.Equal(t, c.KeyFile, r.KeyFile) require.Equal(t, c.KeyFile, r.KeyFile)
require.Equal(t, c.NodeName, r.NodeName) require.Equal(t, c.NodeName, r.NodeName)
require.Equal(t, c.ServerName, r.ServerName) require.Equal(t, c.ServerName, r.ServerName)
require.Equal(t, c.DNSDomain, r.Domain)
require.Equal(t, c.TLSMinVersion, r.TLSMinVersion) require.Equal(t, c.TLSMinVersion, r.TLSMinVersion)
require.Equal(t, c.TLSCipherSuites, r.CipherSuites) require.Equal(t, c.TLSCipherSuites, r.CipherSuites)
require.Equal(t, c.TLSPreferServerCipherSuites, r.PreferServerCipherSuites) require.Equal(t, c.TLSPreferServerCipherSuites, r.PreferServerCipherSuites)