merlimat closed pull request #3360: Support TLS authentication and 
authorization in standalone mode
URL: https://github.com/apache/pulsar/pull/3360
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java 
b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
index 8711bd84d6..c6ee4dc762 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandalone.java
@@ -272,8 +272,16 @@ void start() throws Exception {
                 workerConfig = WorkerConfig.load(this.getFnWorkerConfigFile());
             }
             // worker talks to local broker
-            workerConfig.setPulsarServiceUrl("pulsar://127.0.0.1:" + 
config.getBrokerServicePort().get());
-            workerConfig.setPulsarWebServiceUrl("http://127.0.0.1:"; + 
config.getWebServicePort().get());
+            boolean useTls = workerConfig.isUseTls();
+            String localhost = "127.0.0.1";
+            String pulsarServiceUrl = useTls
+                    ? PulsarService.brokerUrlTls(localhost, 
config.getBrokerServicePortTls().get())
+                    : PulsarService.brokerUrl(localhost, 
config.getBrokerServicePort().get());
+            String webServiceUrl = useTls
+                    ? PulsarService.webAddressTls(localhost, 
config.getWebServicePortTls().get())
+                    : PulsarService.webAddress(localhost, 
config.getWebServicePort().get());
+            workerConfig.setPulsarServiceUrl(pulsarServiceUrl);
+            workerConfig.setPulsarWebServiceUrl(webServiceUrl);
             if (!this.isNoStreamStorage()) {
                 // only set the state storage service url when state is 
enabled.
                 workerConfig.setStateStorageServiceUrl("bk://127.0.0.1:" + 
this.getStreamStoragePort());


 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to