ivmaykov commented on a change in pull request #728: ZOOKEEPER-3160: Custom 
User SSLContext
URL: https://github.com/apache/zookeeper/pull/728#discussion_r248780258
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/common/X509Util.java
 ##########
 @@ -220,6 +224,24 @@ public int getSslHandshakeTimeoutMillis() {
     }
 
     public SSLContext createSSLContext(ZKConfig config) throws 
SSLContextException {
+        if (config.getProperty(sslClientContextProperty) != null) {
+            LOG.debug("Loading SSLContext from property '" + 
sslClientContextProperty + "'");
+            String sslClientContextClass = 
config.getProperty(sslClientContextProperty);
+            try {
+                Class<?> sslContextClass = 
Class.forName(sslClientContextClass);
+                ZKClientSSLContext sslContext = (ZKClientSSLContext) 
sslContextClass.getConstructor().newInstance();
 
 Review comment:
   Functional interfaces allow lambdas and method references but I don't think 
they are restricted to it. But anyway, I don't feel too strongly about it. I 
don't think `Client` should be in the class name (since this works for both 
`QuorumX509Util` and `ClientX509Util`) so if you stick with your own class, I 
would call the interface something like `SSLContextSupplier`.

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