You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/02/10 06:47:13 UTC

[GitHub] rdhabalia commented on a change in pull request #1213: Use SecurityUtility class

rdhabalia commented on a change in pull request #1213: Use SecurityUtility class
URL: https://github.com/apache/incubator-pulsar/pull/1213#discussion_r167391135
 
 

 ##########
 File path: pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ServiceChannelInitializer.java
 ##########
 @@ -55,24 +47,12 @@ public ServiceChannelInitializer(ProxyService proxyService, ProxyConfiguration s
     @Override
     protected void initChannel(SocketChannel ch) throws Exception {
         if (enableTLS) {
-            File tlsCert = new File(serviceConfig.getTlsCertificateFilePath());
-            File tlsKey = new File(serviceConfig.getTlsKeyFilePath());
-            SslContextBuilder builder = SslContextBuilder.forServer(tlsCert, tlsKey);
-            // allows insecure connection
-            builder.trustManager(InsecureTrustManagerFactory.INSTANCE);
-            SslContext sslCtx = builder.clientAuth(ClientAuth.OPTIONAL).build();
+            SslContext sslCtx = SecurityUtility.createNettySslContextForClient(true,
 
 Review comment:
   can we also add comment `SecurityUtility.createNettySslContextForClient(true\* to allow InsecureConnection*\,..)`

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