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 21:51:54 GMT
rdhabalia commented on a change in pull request #3568: Refresh Certs every X minutes
URL: https://github.com/apache/pulsar/pull/3568#discussion_r257835209
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarChannelInitializer.java
 ##########
 @@ -43,21 +43,23 @@
     public PulsarChannelInitializer(PulsarService pulsar, boolean enableTLS) throws Exception
{
         super();
         this.pulsar = pulsar;
-        if (enableTLS) {
+        this.enableTls = enableTLS;
+        if (this.enableTls) {
             ServiceConfiguration serviceConfig = pulsar.getConfiguration();
-            this.sslCtx = SecurityUtility.createNettySslContextForServer(serviceConfig.isTlsAllowInsecureConnection(),
+            sslCtxRefresher = new ServerSslContextRefresher(serviceConfig.isTlsAllowInsecureConnection(),
                     serviceConfig.getTlsTrustCertsFilePath(), serviceConfig.getTlsCertificateFilePath(),
                     serviceConfig.getTlsKeyFilePath(), serviceConfig.getTlsCiphers(), serviceConfig.getTlsProtocols(),
-                    serviceConfig.isTlsRequireTrustedClientCertOnConnect());
+                    serviceConfig.isTlsRequireTrustedClientCertOnConnect(),
+                    serviceConfig.getCertRefreshCheckDurationInMins());
         } else {
-            this.sslCtx = null;
+            this.sslCtxRefresher = null;
         }
     }
 
     @Override
     protected void initChannel(SocketChannel ch) throws Exception {
-        if (sslCtx != null) {
-            ch.pipeline().addLast(TLS_HANDLER, sslCtx.newHandler(ch.alloc()));
+        if (this.enableTls) {
 
 Review comment:
   can you also add null check for `sslCtxRefresher` here.

----------------------------------------------------------------
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