You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/03/21 23:35:31 UTC
[1/2] activemq-artemis git commit: This closes #426
Repository: activemq-artemis
Updated Branches:
refs/heads/master 923c12c7a -> 9c9520106
This closes #426
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/9c952010
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9c952010
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9c952010
Branch: refs/heads/master
Commit: 9c952010699de692e6d358d4169e277ea4f2bd19
Parents: 923c12c 32ce871
Author: Clebert Suconic <cl...@apache.org>
Authored: Mon Mar 21 18:35:21 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Mon Mar 21 18:35:21 2016 -0400
----------------------------------------------------------------------
.../artemis/core/remoting/impl/ssl/SSLSupport.java | 4 ++--
.../unit/core/remoting/impl/ssl/SSLSupportTest.java | 11 +++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[2/2] activemq-artemis git commit: ARTEMIS-445 avoid NPE on null ks
password
Posted by cl...@apache.org.
ARTEMIS-445 avoid NPE on null ks password
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/32ce8710
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/32ce8710
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/32ce8710
Branch: refs/heads/master
Commit: 32ce8710fc23763742adbddb9c4493b45b24583e
Parents: 923c12c
Author: jbertram <jb...@apache.org>
Authored: Mon Mar 21 11:07:29 2016 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Mon Mar 21 18:35:21 2016 -0400
----------------------------------------------------------------------
.../artemis/core/remoting/impl/ssl/SSLSupport.java | 4 ++--
.../unit/core/remoting/impl/ssl/SSLSupportTest.java | 11 +++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/32ce8710/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java
index 5320bac..2b97c75 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/ssl/SSLSupport.java
@@ -103,7 +103,7 @@ public class SSLSupport {
URL keystoreURL = SSLSupport.validateStoreURL(keystorePath);
in = keystoreURL.openStream();
}
- ks.load(in, keystorePassword.toCharArray());
+ ks.load(in, keystorePassword == null ? null : keystorePassword.toCharArray());
}
finally {
if (in != null) {
@@ -126,7 +126,7 @@ public class SSLSupport {
else {
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
KeyStore ks = SSLSupport.loadKeystore(keyStoreProvider, keystorePath, keystorePassword);
- kmf.init(ks, keystorePassword.toCharArray());
+ kmf.init(ks, keystorePassword == null ? null : keystorePassword.toCharArray());
return kmf.getKeyManagers();
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/32ce8710/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java
index cb26552..6ecb385 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/ssl/SSLSupportTest.java
@@ -138,6 +138,17 @@ public class SSLSupportTest extends ActiveMQTestBase {
}
@Test
+ public void testContextWithNullKeyStorePassword() throws Exception {
+ try {
+ SSLSupport.createContext(storeType, keyStorePath, null, storeType, trustStorePath, trustStorePassword);
+ Assert.fail();
+ }
+ catch (Exception e) {
+ assertFalse(e instanceof NullPointerException);
+ }
+ }
+
+ @Test
public void testContextWithBadTrustStorePath() throws Exception {
try {
SSLSupport.createContext(storeType, keyStorePath, keyStorePassword, storeType, "not a trust store", trustStorePassword);