anmolnar commented on code in PR #2117:
URL: https://github.com/apache/zookeeper/pull/2117#discussion_r1524020141


##########
zookeeper-server/src/main/java/org/apache/zookeeper/client/FourLetterWordMain.java:
##########
@@ -101,14 +123,16 @@ public static String send4LetterWord(
                 : new InetSocketAddress(InetAddress.getByName(null), port);
             if (secure) {
                 LOG.info("using secure socket");
-                try (X509Util x509Util = new ClientX509Util()) {
-                    SSLContext sslContext = x509Util.getDefaultSSLContext();
-                    SSLSocketFactory socketFactory = 
sslContext.getSocketFactory();
-                    SSLSocket sslSock = (SSLSocket) 
socketFactory.createSocket();
-                    sslSock.connect(hostaddress, timeout);
-                    sslSock.startHandshake();
-                    sock = sslSock;
+                if (sslContext == null) {
+                    try (X509Util x509Util = new ClientX509Util()) {
+                        sslContext = x509Util.getDefaultSSLContext();
+                    }

Review Comment:
   oh, sure of course.
   thanks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to