Skip to content

Commit

Permalink
Fix broker client tls settings error (#6128)
Browse files Browse the repository at this point in the history
when broker create the inside client, it sets tlsTrustCertsFilePath as "getTlsCertificateFilePath()", but it should be "getBrokerClientTrustCertsFilePath()"
  • Loading branch information
jiazhai committed Feb 24, 2020
1 parent 739c0dd commit 1fcccd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,14 @@ public synchronized PulsarClient getClient() throws PulsarServerException {
.enableTls(this.getConfiguration().isTlsEnabled())
.allowTlsInsecureConnection(this.getConfiguration().isTlsAllowInsecureConnection())
.tlsTrustCertsFilePath(this.getConfiguration().getTlsCertificateFilePath());

if (this.getConfiguration().isBrokerClientTlsEnabled()) {
builder.tlsTrustCertsFilePath(
isNotBlank(this.getConfiguration().getBrokerClientTrustCertsFilePath())
? this.getConfiguration().getBrokerClientTrustCertsFilePath()
: this.getConfiguration().getTlsCertificateFilePath());
}

if (isNotBlank(this.getConfiguration().getBrokerClientAuthenticationPlugin())) {
builder.authentication(this.getConfiguration().getBrokerClientAuthenticationPlugin(),
this.getConfiguration().getBrokerClientAuthenticationParameters());
Expand Down
8 changes: 4 additions & 4 deletions pulsar-client-cpp/python/pulsar_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_redelivery_count(self):
producer.send(b'hello')

redelivery_count = 0
for i in range(4):
for i in range(4):
msg = consumer.receive(TM)
print("Received message %s" % msg.data())
consumer.negative_acknowledge(msg)
Expand Down Expand Up @@ -668,13 +668,13 @@ def test_publish_compact_and_consume(self):
while True:
s=doHttpGet(url).decode('utf-8')
if 'RUNNING' in s:
print("Compact still running")
print(s)
print("Compact still running")
time.sleep(0.2)
else:
self.assertTrue('SUCCESS' in s)
print("Compact Complete now")
print(s)
print("Compact Complete now")
self.assertTrue('SUCCESS' in s)
break

# after compaction completes the compacted ledger is recorded
Expand Down

0 comments on commit 1fcccd6

Please sign in to comment.