Skip to content

Commit e05a06e

Browse files
committed
[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 <yacovm@il.ibm.com>
1 parent 118f82f commit e05a06e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gossip/comm/comm_impl.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ func (c *commImpl) createConnection(endpoint string, expectedPKIID common.PKIidT
217217
conn.handler = h
218218
return conn, nil
219219
}
220+
c.logger.Warning("Authentication failed:", err)
220221
}
221222
cc.Close()
222223
return nil, err
@@ -320,6 +321,7 @@ func (c *commImpl) Handshake(remotePeer *RemotePeer) (api.PeerIdentityType, erro
320321
}
321322
connInfo, err := c.authenticateRemotePeer(stream)
322323
if err != nil {
324+
c.logger.Warning("Authentication failed:", err)
323325
return nil, err
324326
}
325327
if len(remotePeer.PKIID) > 0 && !bytes.Equal(connInfo.ID, remotePeer.PKIID) {
@@ -516,7 +518,7 @@ func (c *commImpl) GossipStream(stream proto.Gossip_GossipStreamServer) error {
516518
}
517519
connInfo, err := c.authenticateRemotePeer(stream)
518520
if err != nil {
519-
c.logger.Error("Authentication failed")
521+
c.logger.Error("Authentication failed:", err)
520522
return err
521523
}
522524
c.logger.Debug("Servicing", extractRemoteAddress(stream))

0 commit comments

Comments
 (0)