lhotari commented on code in PR #23798:
URL: https://github.com/apache/pulsar/pull/23798#discussion_r2987573710


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarChannelInitializer.java:
##########
@@ -123,6 +116,23 @@ CompletableFuture<Channel> initTls(Channel ch, 
InetSocketAddress sniHost) {
         CompletableFuture<Channel> initTlsFuture = new CompletableFuture<>();
         ch.eventLoop().execute(() -> {
             try {
+                PulsarSslFactory pulsarSslFactory = 
pulsarSslFactoryMap.computeIfAbsent(sniHost.getHostName(), key -> {
+                    try {
+                        PulsarSslFactory factory = (PulsarSslFactory) 
Class.forName(conf.getSslFactoryPlugin())
+                                .getConstructor().newInstance();
+                        PulsarSslConfiguration sslConfiguration = 
buildSslConfiguration(conf, key);
+                        factory.initialize(sslConfiguration);
+                        factory.createInternalSslContext();
+                        return factory;
+                    } catch (Exception e) {
+                        log.error("Unable to initialize and create the ssl 
context", e);
+                        initTlsFuture.completeExceptionally(e);
+                        return null;
+                    }
+                });
+                if (pulsarSslFactory == null) {
+                    return;
+                }

Review Comment:
   @nodece What is the reason for this change? The PulsarSslFactory shouldn't 
be holding any state related to the hostname. Is this really needed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to