mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-5495 - apply suggested changes to allow keyStoreKeyPassword to be specified in ActiveMQSslConnectionFactory
This commit is contained in:
parent
02d974c409
commit
815e0ec5bf
|
@ -66,6 +66,7 @@ public class ActiveMQSslConnectionFactory extends ActiveMQConnectionFactory {
|
||||||
protected String trustStorePassword;
|
protected String trustStorePassword;
|
||||||
protected String keyStore;
|
protected String keyStore;
|
||||||
protected String keyStorePassword;
|
protected String keyStorePassword;
|
||||||
|
protected String keyStoreKeyPassword;
|
||||||
|
|
||||||
public ActiveMQSslConnectionFactory() {
|
public ActiveMQSslConnectionFactory() {
|
||||||
super();
|
super();
|
||||||
|
@ -148,7 +149,7 @@ public class ActiveMQSslConnectionFactory extends ActiveMQConnectionFactory {
|
||||||
if (sslCert != null && sslCert.length > 0) {
|
if (sslCert != null && sslCert.length > 0) {
|
||||||
ByteArrayInputStream bin = new ByteArrayInputStream(sslCert);
|
ByteArrayInputStream bin = new ByteArrayInputStream(sslCert);
|
||||||
ks.load(bin, keyStorePassword.toCharArray());
|
ks.load(bin, keyStorePassword.toCharArray());
|
||||||
kmf.init(ks, keyStorePassword.toCharArray());
|
kmf.init(ks, keyStoreKeyPassword !=null ? keyStoreKeyPassword.toCharArray() : keyStorePassword.toCharArray());
|
||||||
keystoreManagers = kmf.getKeyManagers();
|
keystoreManagers = kmf.getKeyManagers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -268,4 +269,20 @@ public class ActiveMQSslConnectionFactory extends ActiveMQConnectionFactory {
|
||||||
this.keyStorePassword = keyStorePassword;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue