Skip to content

Commit

Permalink
FAB-6266: fix SSL errors with multiple peers
Browse files Browse the repository at this point in the history
This is only the work around of this issue.
The root cause exists in grpc-node. When clients try to establish channel
with tls configured, the certs are loaded as buffer in node, and it will
be converted into string in gprc. But the string is not properly terminated
and more from the memory is appended. Sometimes part of the cert will be
appended, which will raise the error that the cert cannot be added. And
when more is appended to the cert, it will take more and more time to
transmit the message. Then timetout issue arises.

Change-Id: Ib4dc9656a1b17c9f1e22dc7f1225439c9582dba0
Signed-off-by: Wang Dong <[email protected]>
  • Loading branch information
nobody4t committed Nov 27, 2017
1 parent acd8db6 commit 88e6b90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fabric-client/lib/Remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ var Endpoint = class {
throw new Error('clientKey and clientCert are both required.')
}
} else {
this.creds = grpc.credentials.createSsl(Buffer.from(pem));
var pembuf = Buffer.concat([Buffer.from(pem), Buffer.from('\0')]);
this.creds = grpc.credentials.createSsl(pembuf);
}
this.addr = purl.host;
} else {
Expand Down

0 comments on commit 88e6b90

Please sign in to comment.