set server configuration checksum on reload

This commit is contained in:
Chelsea Holland Komlo
2018-03-27 18:00:41 -04:00
parent f8df2071ef
commit 7de20ac806
3 changed files with 3 additions and 0 deletions

View File

@@ -414,6 +414,7 @@ func (c *Client) reloadTLSConnections(newConfig *nconfig.TLSConfig) error {
// decide on what type of connections to accept
c.configLock.Lock()
c.config.TLSConfig = newConfig
c.config.TLSConfig.SetChecksum()
c.configLock.Unlock()
c.connPool.ReloadTLS(tlsWrap)

View File

@@ -471,6 +471,7 @@ func (s *Server) reloadTLSConnections(newTLSConfig *config.TLSConfig) error {
// access to config information, such as rpc.go, where we decide on what kind
// of network connections to accept depending on the server configuration
s.config.TLSConfig = newTLSConfig
s.config.TLSConfig.SetChecksum()
s.rpcTLS = incomingTLS
s.connPool.ReloadTLS(tlsWrap)

View File

@@ -427,6 +427,7 @@ func TestServer_Reload_TLSConnections_PlaintextToTLS_OnlyRPC(t *testing.T) {
err := s1.reloadTLSConnections(newTLSConfig)
assert.Nil(err)
assert.True(s1.config.TLSConfig.EnableRPC)
assert.True(s1.config.TLSConfig.CertificateInfoIsEqual(newTLSConfig))
codec := rpcClient(t, s1)