Repository: cxf Updated Branches: refs/heads/master 8eb78c390 -> a0f0667ad
Make some security tests work with the IBM JDK Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a0f0667a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a0f0667a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a0f0667a Branch: refs/heads/master Commit: a0f0667ad6ef136ed32707d361732617bc152c2e Parents: 8eb78c3 Author: Colm O hEigeartaigh <[email protected]> Authored: Fri Oct 2 20:13:48 2015 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Fri Oct 2 20:13:48 2015 +0100 ---------------------------------------------------------------------- .../stsclient/STSTokenOutInterceptorTest.java | 5 +++++ .../sts/stsclient/STSTokenRetrieverTest.java | 5 +++++ .../sts/transport/TransportBindingTest.java | 10 ++++++++++ .../https/ciphersuites/CipherSuitesTest.java | 20 ++++++++++++++++++++ 4 files changed, 40 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/a0f0667a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenOutInterceptorTest.java ---------------------------------------------------------------------- diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenOutInterceptorTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenOutInterceptorTest.java index bdafbc8..683f8f7 100644 --- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenOutInterceptorTest.java +++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenOutInterceptorTest.java @@ -284,6 +284,11 @@ public class STSTokenOutInterceptorTest extends AbstractBusClientServerTestBase SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); + + // Needed to prevent test failure using IBM JDK + if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { + System.setProperty("https.protocols", "TLSv1"); + } } private TLSClientParameters prepareTLSParams() throws KeyStoreException, IOException, http://git-wip-us.apache.org/repos/asf/cxf/blob/a0f0667a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenRetrieverTest.java ---------------------------------------------------------------------- diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenRetrieverTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenRetrieverTest.java index ca14481..3b585f7 100644 --- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenRetrieverTest.java +++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/stsclient/STSTokenRetrieverTest.java @@ -222,6 +222,11 @@ public class STSTokenRetrieverTest extends AbstractBusClientServerTestBase { SSLContext sc = SSLContext.getInstance("SSL"); sc.init(null, trustManagers, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); + + // Needed to prevent test failure using IBM JDK + if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { + System.setProperty("https.protocols", "TLSv1"); + } } private TLSClientParameters prepareTLSParams() throws KeyStoreException, IOException, http://git-wip-us.apache.org/repos/asf/cxf/blob/a0f0667a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java ---------------------------------------------------------------------- diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java index 748d607..ea4ace1 100644 --- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java +++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java @@ -295,6 +295,11 @@ public class TransportBindingTest extends AbstractBusClientServerTestBase { @org.junit.Test public void testSAML2Dispatch() throws Exception { + + // Needed to prevent test failure using IBM JDK + if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { + System.setProperty("https.protocols", "TLSv1"); + } SpringBusFactory bf = new SpringBusFactory(); URL busFile = TransportBindingTest.class.getResource("cxf-client.xml"); @@ -337,6 +342,11 @@ public class TransportBindingTest extends AbstractBusClientServerTestBase { @org.junit.Test public void testSAML2DispatchLocation() throws Exception { + + // Needed to prevent test failure using IBM JDK + if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { + System.setProperty("https.protocols", "TLSv1"); + } SpringBusFactory bf = new SpringBusFactory(); URL busFile = TransportBindingTest.class.getResource("cxf-client.xml"); http://git-wip-us.apache.org/repos/asf/cxf/blob/a0f0667a/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java ---------------------------------------------------------------------- diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java b/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java index 6b704ad..d635ef0 100644 --- a/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java +++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java @@ -143,6 +143,11 @@ public class CipherSuitesTest extends AbstractBusClientServerTestBase { @org.junit.Test public void testAESIncludedExplicitly() throws Exception { + // Doesn't work with IBM JDK + if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { + return; + } + if (!UNRESTRICTED_POLICIES_INSTALLED) { return; } @@ -455,6 +460,11 @@ public class CipherSuitesTest extends AbstractBusClientServerTestBase { // Both client + server include AES, client enables a TLS v1.2 CipherSuite @org.junit.Test public void testAESIncludedTLSv12() throws Exception { + // Doesn't work with IBM JDK + if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { + return; + } + SpringBusFactory bf = new SpringBusFactory(); URL busFile = CipherSuitesTest.class.getResource("ciphersuites-client-tlsv12.xml"); @@ -479,6 +489,11 @@ public class CipherSuitesTest extends AbstractBusClientServerTestBase { // Both client + server include AES, client enables a TLS v1.2 CipherSuite @org.junit.Test public void testAESIncludedTLSv12ViaCode() throws Exception { + // Doesn't work with IBM JDK + if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { + return; + } + SpringBusFactory bf = new SpringBusFactory(); URL busFile = CipherSuitesTest.class.getResource("ciphersuites-client-noconfig.xml"); @@ -518,6 +533,11 @@ public class CipherSuitesTest extends AbstractBusClientServerTestBase { // Both client + server include AES, client is TLSv1.1 @org.junit.Test public void testAESIncludedTLSv11() throws Exception { + // Doesn't work with IBM JDK + if ("IBM Corporation".equals(System.getProperty("java.vendor"))) { + return; + } + SpringBusFactory bf = new SpringBusFactory(); URL busFile = CipherSuitesTest.class.getResource("ciphersuites-client-noconfig.xml");
