merlimat commented on a change in pull request #2315: Enable TLS in client if 
serviceUrl has pulsar+ssl:// or https://
URL: https://github.com/apache/incubator-pulsar/pull/2315#discussion_r207970676
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientBuilderImpl.java
 ##########
 @@ -66,6 +65,7 @@ public ClientBuilder loadConf(Map<String, Object> config) {
     @Override
     public ClientBuilder serviceUrl(String serviceUrl) {
         conf.setServiceUrl(serviceUrl);
+        enableTls(serviceUrl.startsWith("pulsar+ssl") || 
serviceUrl.startsWith("https"));
 
 Review comment:
   To retain previous behavior as well (even if it doesn't make a lot of 
practical sense), here we could do: 
   
   ```java
   if (!conf.isUseTls()) {
      enableTls(serviceUrl.startsWith("pulsar+ssl") || 
serviceUrl.startsWith("https"));
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to