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,
KeyFile: c.KeyFile,
NodeName: c.NodeName,
Domain: c.DNSDomain,
ServerName: c.ServerName,
TLSMinVersion: c.TLSMinVersion,
CipherSuites: c.TLSCipherSuites,

View File

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