Skip to content

Commit

Permalink
fix broker client tls settings error
Browse files Browse the repository at this point in the history
  • Loading branch information
jiazhai committed Jan 23, 2020
1 parent 275854e commit 4f889e5
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -873,12 +873,16 @@ public synchronized PulsarClient getClient() throws PulsarServerException {
ClientBuilder builder = PulsarClient.builder()
.serviceUrl(this.getConfiguration().isTlsEnabled()
? this.brokerServiceUrlTls : this.brokerServiceUrl)
.enableTls(this.getConfiguration().isTlsEnabled())
.allowTlsInsecureConnection(this.getConfiguration().isTlsAllowInsecureConnection())
.tlsTrustCertsFilePath(this.getConfiguration().getTlsCertificateFilePath());
.enableTls(this.getConfiguration().isTlsEnabled());

if (this.getConfiguration().isBrokerClientTlsEnabled()) {
builder.allowTlsInsecureConnection(this.getConfiguration().isTlsAllowInsecureConnection());
builder.tlsTrustCertsFilePath(this.getConfiguration().getBrokerClientTrustCertsFilePath());
}

if (isNotBlank(this.getConfiguration().getBrokerClientAuthenticationPlugin())) {
builder.authentication(this.getConfiguration().getBrokerClientAuthenticationPlugin(),
this.getConfiguration().getBrokerClientAuthenticationParameters());
this.getConfiguration().getBrokerClientAuthenticationParameters());
}
this.client = builder.build();
} catch (Exception e) {
Expand Down

0 comments on commit 4f889e5

Please sign in to comment.