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 <[email protected]> Authored: Mon Dec 22 15:26:40 2014 +0000 Committer: gtully <[email protected]> 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; + } + }
