pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] rdhabalia commented on a change in pull request #3568: Refresh Certs every X minutes
Date Mon, 18 Feb 2019 18:24:05 GMT
rdhabalia commented on a change in pull request #3568: Refresh Certs every X minutes
URL: https://github.com/apache/pulsar/pull/3568#discussion_r257791316
 
 

 ##########
 File path: pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ServiceChannelInitializer.java
 ##########
 @@ -65,27 +66,22 @@ public ServiceChannelInitializer(ProxyService proxyService, ProxyConfiguration
s
                         serviceConfig.getBrokerClientAuthenticationParameters()).getAuthData();
             }
 
-            if (authData != null && authData.hasDataForTls()) {
-                    this.clientSslCtx = SecurityUtility.createNettySslContextForClient(
-                            serviceConfig.isTlsAllowInsecureConnection(), serviceConfig.getBrokerClientTrustCertsFilePath(),
-                            (X509Certificate[]) authData.getTlsCertificates(), authData.getTlsPrivateKey());
-                } else {
-                    this.clientSslCtx = SecurityUtility.createNettySslContextForClient(
-                            serviceConfig.isTlsAllowInsecureConnection(),
-                            serviceConfig.getBrokerClientTrustCertsFilePath());
-            }
+            clientSslCtxRefresher = new ClientSslContextRefresher(serviceConfig.isTlsAllowInsecureConnection(),
+                    serviceConfig.getBrokerClientTrustCertsFilePath(), authData);
+
         } else {
-            this.clientSslCtx = null;
+            this.clientSslCtxRefresher = null;
         }
     }
 
     @Override
     protected void initChannel(SocketChannel ch) throws Exception {
-        if (serverSslCtx != null) {
-            ch.pipeline().addLast(TLS_HANDLER, serverSslCtx.newHandler(ch.alloc()));
+        if (this.enableTls) {
 
 Review comment:
   can we check null for `serverSslCtxRefresher` to avoid NPE in future.

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


With regards,
Apache Git Services

Mime
View raw message