From e05a06e24b4d78f816c0a50b6244fef59a226dfc Mon Sep 17 00:00:00 2001 From: YACOVM Date: Wed, 12 Apr 2017 12:07:49 +0300 Subject: [PATCH] [FAB-3113] Add authentication failure cause to logs It is useful to print the cause of the authentication error. Added where it was missing. Change-Id: I942e0944055886027cec3d3e760e49c1a493562c Signed-off-by: Yacov Manevich --- gossip/comm/comm_impl.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gossip/comm/comm_impl.go b/gossip/comm/comm_impl.go index 7f92e61e532..36e799cc0d5 100644 --- a/gossip/comm/comm_impl.go +++ b/gossip/comm/comm_impl.go @@ -217,6 +217,7 @@ func (c *commImpl) createConnection(endpoint string, expectedPKIID common.PKIidT conn.handler = h return conn, nil } + c.logger.Warning("Authentication failed:", err) } cc.Close() return nil, err @@ -320,6 +321,7 @@ func (c *commImpl) Handshake(remotePeer *RemotePeer) (api.PeerIdentityType, erro } connInfo, err := c.authenticateRemotePeer(stream) if err != nil { + c.logger.Warning("Authentication failed:", err) return nil, err } if len(remotePeer.PKIID) > 0 && !bytes.Equal(connInfo.ID, remotePeer.PKIID) { @@ -516,7 +518,7 @@ func (c *commImpl) GossipStream(stream proto.Gossip_GossipStreamServer) error { } connInfo, err := c.authenticateRemotePeer(stream) if err != nil { - c.logger.Error("Authentication failed") + c.logger.Error("Authentication failed:", err) return err } c.logger.Debug("Servicing", extractRemoteAddress(stream))