From dev-return-77310-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Thu Jan 17 20:20:21 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id F185818063F for ; Thu, 17 Jan 2019 20:20:20 +0100 (CET) Received: (qmail 8745 invoked by uid 500); 17 Jan 2019 19:20:19 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 8734 invoked by uid 99); 17 Jan 2019 19:20:19 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jan 2019 19:20:19 +0000 From: GitBox To: dev@zookeeper.apache.org Subject: [GitHub] arankin-irl commented on a change in pull request #728: ZOOKEEPER-3160: Custom User SSLContext Message-ID: <154775281923.15883.14283027942069375983.gitbox@gitbox.apache.org> Date: Thu, 17 Jan 2019 19:20:19 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit arankin-irl commented on a change in pull request #728: ZOOKEEPER-3160: Custom User SSLContext URL: https://github.com/apache/zookeeper/pull/728#discussion_r248803778 ########## 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: I can use the Supplier interface - I just wanted to double check before updating the PR. Haven't really seen it implemented, but that's something that's a bit unique to this use-case. It is just an interface at the end of the day. Renaming the property is grand as well - the name made sense back before ClientX509Util for my specific use-case, but given the changes, renaming it makes more sense. Just checking - we get an unchecked cast warning when instantiating the supplier and casting it to Supplier - should I leave that warning, or suppress that warning? *Edit:* Looks like SuppressWarnings is used elsewhere, so I'll go that route. ---------------------------------------------------------------- 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