Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 4e20ae3

Browse files
committed
FABJ-347 NPE for auto clientcerts
Change-Id: I94dce40d574137725539f8ee4f16dde3d0fdaff6 Signed-off-by: rickr <cr22rc@gmail.com>
1 parent 3c23a7e commit 4e20ae3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/java/org/hyperledger/fabric/sdk/Peer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,10 @@ long getReconnectCount() {
405405
return reconnectCount;
406406
}
407407

408-
void setTLSCertificateKeyPair(TLSCertificateKeyPair tlsCertificateKeyPair) {
408+
synchronized void setTLSCertificateKeyPair(TLSCertificateKeyPair tlsCertificateKeyPair) {
409+
if (properties == null) {
410+
properties = new Properties();
411+
}
409412
properties.put("clientKeyBytes", tlsCertificateKeyPair.getKeyPemBytes());
410413
properties.put("clientCertBytes", tlsCertificateKeyPair.getCertPEMBytes());
411414

src/main/java/org/hyperledger/fabric/sdk/PeerEventServiceClient.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class PeerEventServiceClient {
6262
private final PeerOptions peerOptions;
6363
private final boolean filterBlock;
6464
private byte[] clientTLSCertificateDigest;
65-
Properties properties = new Properties();
6665
StreamObserver<Envelope> nso = null;
6766
StreamObserver<DeliverResponse> so = null;
6867
private Channel.ChannelEventQue channelEventQue;
@@ -91,7 +90,6 @@ class PeerEventServiceClient {
9190
peerEventRegistrationWaitTimeMilliSecs = PEER_EVENT_REGISTRATION_WAIT_TIME;
9291

9392
} else {
94-
this.properties = properties;
9593

9694
String peerEventRegistrationWaitTime = properties.getProperty("peerEventRegistrationWaitTime", Long.toString(PEER_EVENT_REGISTRATION_WAIT_TIME));
9795

@@ -360,8 +358,6 @@ void peerVent(TransactionContext transactionContext) throws TransactionException
360358
start.setNewest(Ab.SeekNewest.getDefaultInstance());
361359
}
362360

363-
// properties.
364-
365361
envelope = createSeekInfoEnvelope(transactionContext,
366362
start.build(),
367363
Ab.SeekPosition.newBuilder()

0 commit comments

Comments
 (0)