summaryrefslogtreecommitdiff
path: root/java/broker/src/test
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2012-01-29 22:57:31 +0000
committerKeith Wall <kwall@apache.org>2012-01-29 22:57:31 +0000
commit948bfbdc46e09ea02808724760d03de51b8abb7f (patch)
treefd0f58fe7c72af8979fd09f575689ea6adf9e7d5 /java/broker/src/test
parent86bfd7d89ab6ccdb6a57aa83c2379c4616e4f3f7 (diff)
downloadqpid-python-948bfbdc46e09ea02808724760d03de51b8abb7f.tar.gz
QPID-3739: Java properties qpid.ssl.keyStoreCertType and qpid.ssl.trustStoreCertType have misleading names and would be better called qpid.ssl.[Key|Trust]ManagerFactory.algorithm
* Introduced two properties qpid.ssl.KeyManagerFactory.algorithm and qpid.ssl.TrustManagerFactory.algorithm to allow a client user to override the algorithm name used when Qpid client constructs a KeyManager or TrustManager. * Continued to support qpid.ssl.keyStoreCertType and qpid.ssl.trustStoreCertType (now marked as deprecated) * Introduced a new Java Broker configuration key connector/ssl/keyManagerFactoryAlgorithm * Continued to support broker configuration key connector/ssl/certType (now marked as deprecated and will issue warning if used). * Changed the default from hardcoded 'SunX509' to the value(s) returned by KeyManagerFactory#getDefaultAlgorithm() and TrustManagerFactory#getDefaultAlgorithm(). This allows the Java Broker and Client to be used out of the box on non-Sun JDKs without having to set qpid.ssl.KeyManagerFactory.algorithm or qpid.ssl.TrustManagerFactory.algorithm. * Updated client docbook documentation. Tested both Java Broker and Client on IBM JDK and ensured all 0-10 and 0-9-1 profiles pass (including SSLTest which was failing prior to this change). git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1237504 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/src/test')
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java b/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
index 81de6be703..abdc7f2246 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/configuration/ServerConfigurationTest.java
@@ -40,6 +40,8 @@ import java.io.IOException;
import java.io.Writer;
import java.util.Locale;
+import javax.net.ssl.KeyManagerFactory;
+
public class ServerConfigurationTest extends QpidTestCase
{
private XMLConfiguration _config = new XMLConfiguration();
@@ -575,17 +577,24 @@ public class ServerConfigurationTest extends QpidTestCase
assertEquals("b", _serverConfig.getConnectorKeyStorePassword());
}
- public void testGetConnectorCertType() throws ConfigurationException
+ public void testConnectorGetKeyManagerAlgorithm() throws ConfigurationException
{
// Check default
_serverConfig.initialise();
- assertEquals("SunX509", _serverConfig.getConnectorCertType());
+ assertEquals(KeyManagerFactory.getDefaultAlgorithm(), _serverConfig.getConnectorKeyManagerFactoryAlgorithm());
// Check value we set
- _config.setProperty("connector.ssl.certType", "a");
+ _config.setProperty("connector.ssl.keyManagerFactoryAlgorithm", "a");
+ _serverConfig = new ServerConfiguration(_config);
+ _serverConfig.initialise();
+ assertEquals("a", _serverConfig.getConnectorKeyManagerFactoryAlgorithm());
+
+ // Ensure we continue to support the old name certType
+ _config.clearProperty("connector.ssl.keyManagerFactoryAlgorithm");
+ _config.setProperty("connector.ssl.certType", "b");
_serverConfig = new ServerConfiguration(_config);
_serverConfig.initialise();
- assertEquals("a", _serverConfig.getConnectorCertType());
+ assertEquals("b", _serverConfig.getConnectorKeyManagerFactoryAlgorithm());
}
public void testGetHousekeepingCheckPeriod() throws ConfigurationException