This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.4.x-fixes by this push:
     new dd845e4  Skip TLSv1 and TLSv1.1 test cases when these protocols are 
disabled (JDK16+)
dd845e4 is described below

commit dd845e492a552b5029c26962e7bf18a61cf177eb
Author: Andriy Redko <[email protected]>
AuthorDate: Wed May 5 20:14:17 2021 -0400

    Skip TLSv1 and TLSv1.1 test cases when these protocols are disabled (JDK16+)
    
    (cherry picked from commit 633c2d8f1a31360c0fba6f9f1885a6aff5595727)
---
 .../systest/https/ciphersuites/CipherSuitesTest.java    | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

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 48f836d..3ceef9a 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
@@ -22,6 +22,7 @@ package org.apache.cxf.systest.https.ciphersuites;
 import java.io.InputStream;
 import java.net.URL;
 import java.security.KeyStore;
+import java.security.Security;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -55,10 +56,12 @@ import org.junit.BeforeClass;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized.Parameters;
 
+import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeThat;
 
 /**
  * A set of tests for TLS ciphersuites
@@ -455,6 +458,9 @@ public class CipherSuitesTest extends 
AbstractBusClientServerTestBase {
         if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
             return;
         }
+        
+        // Since JDK16, TLS 1.0 and 1.1 are disabled 
+        assumeThat("TLSv1.1 is enabled", isProtocolDisabled("TLSv1.1"), 
is(false));
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = 
CipherSuitesTest.class.getResource("ciphersuites-client-noconfig.xml");
@@ -501,6 +507,9 @@ public class CipherSuitesTest extends 
AbstractBusClientServerTestBase {
         if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
             return;
         }
+        
+        // Since JDK16, TLS 1.0 and 1.1 are disabled 
+        assumeThat("TLSv1.1 is enabled", isProtocolDisabled("TLSv1.1"), 
is(false));
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = 
CipherSuitesTest.class.getResource("ciphersuites-client-noconfig.xml");
@@ -550,10 +559,12 @@ public class CipherSuitesTest extends 
AbstractBusClientServerTestBase {
         bus.shutdown(true);
     }
 
-
     // Both client + server include AES, client is TLSv1.0
     @org.junit.Test
     public void testAESIncludedTLSv10() throws Exception {
+        // Since JDK16, TLS 1.0 and 1.1 are disabled 
+        assumeThat("TLSv1.0 is enabled", isProtocolDisabled("TLSv1"), 
is(false));
+
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = 
CipherSuitesTest.class.getResource("ciphersuites-client-noconfig.xml");
 
@@ -627,4 +638,8 @@ public class CipherSuitesTest extends 
AbstractBusClientServerTestBase {
         bus.shutdown(true);
     }
 
+    private static boolean isProtocolDisabled(String proto) {
+        final String disabledAlgorithms = 
Security.getProperty("jdk.tls.disabledAlgorithms");
+        return disabledAlgorithms != null && 
disabledAlgorithms.contains(proto);
+    }
 }

Reply via email to