diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-03-19 23:09:02 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-03-19 23:09:02 +0000 |
commit | a2a58fcbf9d0d79625bd6c8d4d4a629178f69f13 (patch) | |
tree | 742b16c90919a1ec7a56d4b9adea52b17e3f54fc | |
parent | 6206e26f231780bf84de5c6d57325c28552c4fac (diff) | |
download | qpid-python-a2a58fcbf9d0d79625bd6c8d4d4a629178f69f13.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@925473 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java index 6d6b6db420..05118ffc0e 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java +++ b/qpid/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); } } } |