Skip to content

Commit

Permalink
Fix NPE in gossip integration.go, load tls certificate
Browse files Browse the repository at this point in the history
Currently while gossip loads tls certificate there is a null pointer
dereference, this commit takes care to load certificate correctly.

Change-Id: I28833382770053deaac44578ca8abd1abb464ff2
Signed-off-by: Artem Barger <bartem@il.ibm.com>
  • Loading branch information
C0rWin committed Mar 9, 2017
1 parent 99c8a68 commit 6c146d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gossip/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ func newConfig(selfEndpoint string, externalEndpoint string, bootPeers ...string

var cert *tls.Certificate
if viper.GetBool("peer.tls.enabled") {
*cert, err = tls.LoadX509KeyPair(viper.GetString("peer.tls.cert.file"), viper.GetString("peer.tls.key.file"))
certTmp, err := tls.LoadX509KeyPair(viper.GetString("peer.tls.cert.file"), viper.GetString("peer.tls.key.file"))
if err != nil {
panic(err)
}
cert = &certTmp
}

return &gossip.Config{
Expand Down

0 comments on commit 6c146d1

Please sign in to comment.