command/agent: fix up gossip encryption indicator

This commit is contained in:
Ryan Uber 2014-10-03 19:20:58 -07:00
parent 7a74f559b9
commit 22b2c63304
3 changed files with 16 additions and 1 deletions

View File

@ -619,6 +619,11 @@ func (c *Command) Run(args []string) int {
}(wp)
}
// Figure out if gossip is encrypted
gossipEncrypted := (config.Server &&
c.agent.server.Encrypted() ||
c.agent.client.Encrypted())
// Let the agent know we've finished registration
c.agent.StartSync()
@ -631,7 +636,7 @@ func (c *Command) Run(args []string) int {
c.Ui.Info(fmt.Sprintf(" Cluster Addr: %v (LAN: %d, WAN: %d)", config.AdvertiseAddr,
config.Ports.SerfLan, config.Ports.SerfWan))
c.Ui.Info(fmt.Sprintf("Gossip encrypt: %v, RPC-TLS: %v, TLS-Incoming: %v",
c.gossipEncrypted(), config.VerifyOutgoing, config.VerifyIncoming))
gossipEncrypted, config.VerifyOutgoing, config.VerifyIncoming))
// Enable log streaming
c.Ui.Info("")

View File

@ -211,6 +211,11 @@ func (c *Client) KeyManagerLAN() *serf.KeyManager {
return c.serf.KeyManager()
}
// Encrypted determines if gossip is encrypted
func (c *Client) Encrypted() bool {
return c.serf.EncryptionEnabled()
}
// lanEventHandler is used to handle events from the lan Serf cluster
func (c *Client) lanEventHandler() {
for {

View File

@ -561,6 +561,11 @@ func (s *Server) KeyManagerWAN() *serf.KeyManager {
return s.serfWAN.KeyManager()
}
// Encrypted determines if gossip is encrypted
func (s *Server) Encrypted() bool {
return s.serfLAN.EncryptionEnabled() && s.serfWAN.EncryptionEnabled()
}
// inmemCodec is used to do an RPC call without going over a network
type inmemCodec struct {
method string