Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 773AF10035 for ; Mon, 22 Dec 2014 15:28:20 +0000 (UTC) Received: (qmail 48416 invoked by uid 500); 22 Dec 2014 15:28:20 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 48373 invoked by uid 500); 22 Dec 2014 15:28:20 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 48364 invoked by uid 99); 22 Dec 2014 15:28:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Dec 2014 15:28:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0804DA32A6B; Mon, 22 Dec 2014 15:28:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gtully@apache.org To: commits@activemq.apache.org Message-Id: <8831ee8f10194203beed17517d550506@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: activemq git commit: https://issues.apache.org/jira/browse/AMQ-5495 - apply suggested changes to allow keyStoreKeyPassword to be specified in ActiveMQSslConnectionFactory Date: Mon, 22 Dec 2014 15:28:20 +0000 (UTC) Repository: activemq Updated Branches: refs/heads/trunk 02d974c40 -> 815e0ec5b https://issues.apache.org/jira/browse/AMQ-5495 - apply suggested changes to allow keyStoreKeyPassword to be specified in ActiveMQSslConnectionFactory Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/815e0ec5 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/815e0ec5 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/815e0ec5 Branch: refs/heads/trunk Commit: 815e0ec5bf5dbda4eb0cae2b385729aef033ad16 Parents: 02d974c Author: gtully Authored: Mon Dec 22 15:26:40 2014 +0000 Committer: gtully Committed: Mon Dec 22 15:26:40 2014 +0000 ---------------------------------------------------------------------- .../activemq/ActiveMQSslConnectionFactory.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/815e0ec5/activemq-client/src/main/java/org/apache/activemq/ActiveMQSslConnectionFactory.java ---------------------------------------------------------------------- diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQSslConnectionFactory.java b/activemq-client/src/main/java/org/apache/activemq/ActiveMQSslConnectionFactory.java index fe9d52f..7a0e063 100644 --- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQSslConnectionFactory.java +++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQSslConnectionFactory.java @@ -66,6 +66,7 @@ public class ActiveMQSslConnectionFactory extends ActiveMQConnectionFactory { protected String trustStorePassword; protected String keyStore; protected String keyStorePassword; + protected String keyStoreKeyPassword; public ActiveMQSslConnectionFactory() { super(); @@ -148,7 +149,7 @@ public class ActiveMQSslConnectionFactory extends ActiveMQConnectionFactory { if (sslCert != null && sslCert.length > 0) { ByteArrayInputStream bin = new ByteArrayInputStream(sslCert); ks.load(bin, keyStorePassword.toCharArray()); - kmf.init(ks, keyStorePassword.toCharArray()); + kmf.init(ks, keyStoreKeyPassword !=null ? keyStoreKeyPassword.toCharArray() : keyStorePassword.toCharArray()); keystoreManagers = kmf.getKeyManagers(); } } @@ -268,4 +269,20 @@ public class ActiveMQSslConnectionFactory extends ActiveMQConnectionFactory { this.keyStorePassword = keyStorePassword; } + + public String getKeyStoreKeyPassword() { + return keyStoreKeyPassword; + } + + /** + * The password to match the key from the keyStore. + * + * @param keyStoreKeyPassword + * The password for the private key stored in the + * keyStore if different from keyStorePassword. + */ + public void setKeyStoreKeyPassword(String keyStoreKeyPassword) { + this.keyStoreKeyPassword = keyStoreKeyPassword; + } + }