summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2010-03-19 23:09:02 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2010-03-19 23:09:02 +0000
commitc8a18f698439746d0bb5e9fda1dec47ff34822df (patch)
treef779e97c28100b6ea1b5e4746e4ac57fe2897160
parentc196b8ef7ae21de43b0d4ccfb9252ee7d2b47733 (diff)
downloadqpid-python-c8a18f698439746d0bb5e9fda1dec47ff34822df.tar.gz
Modified SSLTest to temporarily set all ssl jvm args to invalid values, to test all connection level ssl params.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@925473 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java b/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java
index 6d6b6db420..05118ffc0e 100644
--- a/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java
@@ -16,19 +16,24 @@ public class SSLTest extends QpidTestCase
{
String url = "amqp://guest:guest@test/?brokerlist='tcp://localhost:%s" +
"?ssl='true'&ssl_verify_hostname='true'" +
- "&key_store='%s'&keystore_password='%s'" +
+ "&key_store='%s'&key_store_password='%s'" +
"&trust_store='%s'&trust_store_password='%s'" +
"'";
+
+ String keyStore = System.getProperty("javax.net.ssl.keyStore");
+ String keyStorePass = System.getProperty("javax.net.ssl.keyStorePassword");
+ String trustStore = System.getProperty("javax.net.ssl.trustStore");
+ String trustStorePass = System.getProperty("javax.net.ssl.trustStorePassword");
+
url = String.format(url,System.getProperty("test.port.ssl"),
- System.getProperty("javax.net.ssl.keyStore"),
- System.getProperty("javax.net.ssl.keyStorePassword"),
- System.getProperty("javax.net.ssl.trustStore"),
- System.getProperty("javax.net.ssl.trustStorePassword"));
+ keyStore,keyStorePass,trustStore,trustStorePass);
- // temporarily set the trust store jvm arg to something else
+ // temporarily set the trust/key store jvm args to something else
// to ensure we only read from the connection URL param.
- String tmp = System.getProperty("javax.net.ssl.trustStore");
System.setProperty("javax.net.ssl.trustStore","fessgsdgd");
+ System.setProperty("javax.net.ssl.trustStorePassword","fessgsdgd");
+ System.setProperty("javax.net.ssl.keyStore","fessgsdgd");
+ System.setProperty("javax.net.ssl.keyStorePassword","fessgsdgd");
try
{
AMQConnection con = new AMQConnection(url);
@@ -40,7 +45,10 @@ public class SSLTest extends QpidTestCase
}
finally
{
- System.setProperty("javax.net.ssl.trustStore",tmp);
+ System.setProperty("javax.net.ssl.trustStore",trustStore);
+ System.setProperty("javax.net.ssl.trustStorePassword",trustStorePass);
+ System.setProperty("javax.net.ssl.keyStore",keyStore);
+ System.setProperty("javax.net.ssl.keyStorePassword",keyStorePass);
}
}
}