From 645ecae120b8c7619cf62285069dbf8942419ba5 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Tue, 13 Jan 2009 16:12:28 +0000 Subject: This is related to QPID-1572. The SSL test profile runs the java client against the C++ broker using SSL connections git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@734166 13f79535-47bb-0310-9956-ffa450edef68 --- java/cpp.ssl.testprofile | 12 ++++++++++++ java/module.xml | 3 +++ .../org/apache/qpid/test/utils/QpidTestCase.java | 9 ++++++++- java/test-provider.properties | 1 + java/test_resources/ssl/certstore.jks | Bin 0 -> 573 bytes java/test_resources/ssl/keystore.jks | Bin 0 -> 2362 bytes java/test_resources/ssl/pfile | 1 + java/test_resources/ssl/server_db/cert8.db | Bin 0 -> 65536 bytes java/test_resources/ssl/server_db/key3.db | Bin 0 -> 16384 bytes java/test_resources/ssl/server_db/secmod.db | Bin 0 -> 16384 bytes java/test_resources/ssl/server_db/server.crt | 13 +++++++++++++ java/test_resources/ssl/server_db/server.req | 21 +++++++++++++++++++++ 12 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 java/cpp.ssl.testprofile create mode 100644 java/test_resources/ssl/certstore.jks create mode 100644 java/test_resources/ssl/keystore.jks create mode 100644 java/test_resources/ssl/pfile create mode 100644 java/test_resources/ssl/server_db/cert8.db create mode 100644 java/test_resources/ssl/server_db/key3.db create mode 100644 java/test_resources/ssl/server_db/secmod.db create mode 100644 java/test_resources/ssl/server_db/server.crt create mode 100644 java/test_resources/ssl/server_db/server.req (limited to 'java') diff --git a/java/cpp.ssl.testprofile b/java/cpp.ssl.testprofile new file mode 100644 index 0000000000..974e10baac --- /dev/null +++ b/java/cpp.ssl.testprofile @@ -0,0 +1,12 @@ +broker.version=0-10 +broker=${project.root}/../cpp/src/qpidd -p @PORT --load-module ${project.root}/../cpp/src/.libs/ssl.so --ssl-cert-password-file ${project.root}/test_resources/ssl/pfile --ssl-cert-db ${project.root}/test_resources/ssl/server_db/ --ssl-require-client-authentication --data-dir ${build.data}/@PORT -t --auth no +test.excludesfile=${project.root}/ExcludeList ${project.root}/010ExcludeList +test.excludeslist=org.apache.qpid.test.client.failover.FailoverTest#* +profile.use_ssl=true +broker.ready= Listening for SSL connections + +javax.net.ssl.keyStore=${project.root}/test_resources/ssl/keystore.jks +javax.net.ssl.keyStorePassword=password +javax.net.ssl.trustStore=${project.root}/test_resources/ssl/certstore.jks +javax.net.ssl.trustStorePassword=password + diff --git a/java/module.xml b/java/module.xml index 422d2e1057..3bf0f13cc8 100644 --- a/java/module.xml +++ b/java/module.xml @@ -244,6 +244,9 @@ + + + diff --git a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java index 085578c13d..d0bb265a0c 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java +++ b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java @@ -518,7 +518,14 @@ public class QpidTestCase extends TestCase _logger.info("get ConnectionFactory"); if (_connectionFactory == null) { - _connectionFactory = getConnectionFactory("default"); + if (Boolean.getBoolean("profile.use_ssl")) + { + _connectionFactory = getConnectionFactory("ssl"); + } + else + { + _connectionFactory = getConnectionFactory("default"); + } } return _connectionFactory; } diff --git a/java/test-provider.properties b/java/test-provider.properties index 7c9622630c..8066256f4f 100644 --- a/java/test-provider.properties +++ b/java/test-provider.properties @@ -21,6 +21,7 @@ connectionfactory.default = amqp://username:password@clientid/test?brokerlist='tcp://localhost:5672' connectionfactory.default.vm = amqp://username:password@clientid/test?brokerlist='vm://:1' +connectionfactory.ssl = amqp://username:password@clientid/test?brokerlist='tcp://localhost:5671?ssl='true'' connectionfactory.failover = amqp://username:password@clientid/test?brokerlist='tcp://localhost:5673;tcp://localhost:5672' connectionfactory.failover.vm = amqp://username:password@clientid/test?brokerlist='vm://:2;vm://:1' diff --git a/java/test_resources/ssl/certstore.jks b/java/test_resources/ssl/certstore.jks new file mode 100644 index 0000000000..69dd1d252b Binary files /dev/null and b/java/test_resources/ssl/certstore.jks differ diff --git a/java/test_resources/ssl/keystore.jks b/java/test_resources/ssl/keystore.jks new file mode 100644 index 0000000000..ef2df733d6 Binary files /dev/null and b/java/test_resources/ssl/keystore.jks differ diff --git a/java/test_resources/ssl/pfile b/java/test_resources/ssl/pfile new file mode 100644 index 0000000000..f3097ab130 --- /dev/null +++ b/java/test_resources/ssl/pfile @@ -0,0 +1 @@ +password diff --git a/java/test_resources/ssl/server_db/cert8.db b/java/test_resources/ssl/server_db/cert8.db new file mode 100644 index 0000000000..db6c7b7d79 Binary files /dev/null and b/java/test_resources/ssl/server_db/cert8.db differ diff --git a/java/test_resources/ssl/server_db/key3.db b/java/test_resources/ssl/server_db/key3.db new file mode 100644 index 0000000000..f53328c39b Binary files /dev/null and b/java/test_resources/ssl/server_db/key3.db differ diff --git a/java/test_resources/ssl/server_db/secmod.db b/java/test_resources/ssl/server_db/secmod.db new file mode 100644 index 0000000000..4ea614d2f5 Binary files /dev/null and b/java/test_resources/ssl/server_db/secmod.db differ diff --git a/java/test_resources/ssl/server_db/server.crt b/java/test_resources/ssl/server_db/server.crt new file mode 100644 index 0000000000..24faa82328 --- /dev/null +++ b/java/test_resources/ssl/server_db/server.crt @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIICBjCCAW+gAwIBAgIFAItAexIwDQYJKoZIhvcNAQEEBQAwODELMAkGA1UEBhMC +Q0ExCzAJBgNVBAgTAk9OMQswCQYDVQQKEwJSSDEPMA0GA1UEAxMGUm9vdENBMB4X +DTA4MTAyNDE4MjExMVoXDTA5MDEyNDE4MjExMVowRzELMAkGA1UEBhMCQ0ExCzAJ +BgNVBAgTAk9OMQswCQYDVQQKEwJSSDEeMBwGA1UEAxMVbG9jYWxob3N0LmxvY2Fs +ZG9tYWluMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClh0DtKzSgDVjtJHdm +GQPiMOWG2IIob3L9rK53GTz4VwN+y44WmBGGIp3dOXwwXPdKzCf7+d6DzaCnYozz +izBtj68EDhynOWGfHXRYvY7K7rKBnpKucPAe3JmNlQqj/OPurHA0KCoF1BIkJ0mv +7/9u5foPbssrzGHq7iBLB2P7rQIDAQABow0wCzAJBgNVHRMEAjAAMA0GCSqGSIb3 +DQEBBAUAA4GBADmVLjHDo0Uu4/jmfzDHrpPlNokWrHiIe4DtrBXoVQMeZXzlgclQ +CZxEj6Gr9kxP3wiT81KBsTyXpMrQBQidqBDaQRbsx+qhL7ZZHwwBZbuKKyp9OGe9 +JjPTjqlECI0SdCAd0CUWwZonCPl2LCKIYbpUFCSvsYXWCsmIPzzMPMHd +-----END CERTIFICATE----- diff --git a/java/test_resources/ssl/server_db/server.req b/java/test_resources/ssl/server_db/server.req new file mode 100644 index 0000000000..bc938580e8 --- /dev/null +++ b/java/test_resources/ssl/server_db/server.req @@ -0,0 +1,21 @@ + +Certificate request generated by Netscape certutil +Phone: (not specified) + +Common Name: localhost.localdomain +Email: (not specified) +Organization: RH +State: ON +Country: CA + +-----BEGIN NEW CERTIFICATE REQUEST----- +MIIBhjCB8AIBADBHMQswCQYDVQQGEwJDQTELMAkGA1UECBMCT04xCzAJBgNVBAoT +AlJIMR4wHAYDVQQDExVsb2NhbGhvc3QubG9jYWxkb21haW4wgZ8wDQYJKoZIhvcN +AQEBBQADgY0AMIGJAoGBAKWHQO0rNKANWO0kd2YZA+Iw5YbYgihvcv2srncZPPhX +A37LjhaYEYYind05fDBc90rMJ/v53oPNoKdijPOLMG2PrwQOHKc5YZ8ddFi9jsru +soGekq5w8B7cmY2VCqP84+6scDQoKgXUEiQnSa/v/27l+g9uyyvMYeruIEsHY/ut +AgMBAAGgADANBgkqhkiG9w0BAQQFAAOBgQACXXouY4nsGeMjj0Yp7rmUedBz98e5 +ShlpJWb9T4uH2qrzFyHwPvAGJEFsZE7gKmImwncSJid8ViQLgxzKJuTBqJIRH2kY +qIVcK3lPxjvWj8he+JXxKORezhNbLHlBhLGGNZjnjv8kk15jFduevQeKsHMUN3KP +EcJCs+NR7szy0w== +-----END NEW CERTIFICATE REQUEST----- -- cgit v1.2.1