agent: fix gossip encryption detection

This commit is contained in:
Ryan Uber 2014-10-11 17:29:24 -07:00
parent 8a652c6ffa
commit bc0eb4c16d

View File

@ -612,9 +612,12 @@ func (c *Command) Run(args []string) int {
}
// Figure out if gossip is encrypted
gossipEncrypted := (config.Server &&
c.agent.server.Encrypted() ||
c.agent.client.Encrypted())
var gossipEncrypted bool
if config.Server {
gossipEncrypted = c.agent.server.Encrypted()
} else {
gossipEncrypted = c.agent.client.Encrypted()
}
// Let the agent know we've finished registration
c.agent.StartSync()