Github user eolivelli commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/654#discussion_r222023353
  
    --- Diff: src/java/main/org/apache/zookeeper/common/X509Util.java ---
    @@ -85,60 +85,73 @@ public static SSLContext createSSLContext() throws 
SSLContextException {
         }
     
         public static SSLContext createSSLContext(ZKConfig config) throws 
SSLContextException {
    -        KeyManager[] keyManagers = null;
    -        TrustManager[] trustManagers = null;
    +        if (config.getProperty(ZKConfig.SSL_CLIENT_CONTEXT) != null) {
    +            LOG.debug("Loading SSLContext from property '" + 
ZKConfig.SSL_CLIENT_CONTEXT + "'");
    +            String sslClientContextClass = 
config.getProperty(ZKConfig.SSL_CLIENT_CONTEXT);
    +            try {
    +                Class<?> sslContextClass = 
Class.forName(sslClientContextClass);
    +                ZKClientSSLContext sslContext = (ZKClientSSLContext) 
sslContextClass.newInstance();
    --- End diff --
    
    newInstance is deprecated.
    Can we use getConstructor().newInstance() ?


---

Reply via email to