Skip to content

Commit

Permalink
[FAB-3113] Add authentication failure cause to logs
Browse files Browse the repository at this point in the history
It is useful to print the cause of the authentication error.
Added where it was missing.

Change-Id: I942e0944055886027cec3d3e760e49c1a493562c
Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Apr 12, 2017
1 parent 118f82f commit e05a06e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gossip/comm/comm_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit e05a06e

Please sign in to comment.