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

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


The following commit(s) were added to refs/heads/3.5.x-fixes by this push:
     new effbd7b7d0 Fix SSLv3Test suite since SSLv3 is disabled in 
JDK-1.8.0u422 by https://bugs.openjdk.org/browse/JDK-8190492
effbd7b7d0 is described below

commit effbd7b7d09c21ac867676dc5a7507ac77700cc2
Author: Andriy Redko <[email protected]>
AuthorDate: Mon Oct 7 17:52:38 2024 -0400

    Fix SSLv3Test suite since SSLv3 is disabled in JDK-1.8.0u422 by 
https://bugs.openjdk.org/browse/JDK-8190492
---
 .../src/main/java/org/apache/cxf/helpers/JavaUtils.java | 17 +++++++++++++++--
 .../org/apache/cxf/systests/forked/ssl3/SSLv3Test.java  |  5 ++++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/core/src/main/java/org/apache/cxf/helpers/JavaUtils.java 
b/core/src/main/java/org/apache/cxf/helpers/JavaUtils.java
index 04462d0714..ef22d14f70 100644
--- a/core/src/main/java/org/apache/cxf/helpers/JavaUtils.java
+++ b/core/src/main/java/org/apache/cxf/helpers/JavaUtils.java
@@ -50,14 +50,19 @@ public final class JavaUtils {
 
     private static boolean isJava11Compatible;
     private static boolean isJava9Compatible;
+    private static boolean isJava8Compatible;
     private static boolean isJava8Before161;
     private static Integer javaMajorVersion;
+    private static Integer java8patch;
 
     static {
         String version = SystemPropertyAction.getProperty("java.version");
         try {
-            isJava8Before161 = version.startsWith("1.8.0_")
-                && Integer.parseInt(version.substring(6)) < 161;
+            if (version.startsWith("1.8.0_")) {
+                isJava8Compatible = true;
+                java8patch = Integer.parseInt(version.substring(6));
+                isJava8Before161 = java8patch  < 161;
+            }
         } catch (NumberFormatException ex) {
             isJava8Before161 = false;
         }
@@ -95,6 +100,10 @@ public final class JavaUtils {
         return KEYWORD_PREFIX + keyword;
     }
 
+    public static boolean isJava8Compatible() {
+        return isJava8Compatible;
+    }
+
     public static boolean isJava9Compatible() {
         return isJava9Compatible;
     }
@@ -115,6 +124,10 @@ public final class JavaUtils {
         return isJava8Before161;
     }
 
+    public static boolean isJava8Before(int patch) {
+        return isJava8Compatible && java8patch < patch;
+    }
+
     public static void setJavaMajorVersion(Integer javaMajorVersion) {
         JavaUtils.javaMajorVersion = javaMajorVersion;
     }
diff --git 
a/systests/forked/src/test/java/org/apache/cxf/systests/forked/ssl3/SSLv3Test.java
 
b/systests/forked/src/test/java/org/apache/cxf/systests/forked/ssl3/SSLv3Test.java
index 091f2cc557..a2b927195f 100644
--- 
a/systests/forked/src/test/java/org/apache/cxf/systests/forked/ssl3/SSLv3Test.java
+++ 
b/systests/forked/src/test/java/org/apache/cxf/systests/forked/ssl3/SSLv3Test.java
@@ -45,6 +45,7 @@ import org.apache.hello_world.services.SOAPService;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
+import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.Matchers.lessThan;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -162,6 +163,9 @@ public class SSLv3Test extends 
AbstractBusClientServerTestBase {
         assumeThat("SSLv3 is disabled in JDK-11+ by 
https://bugs.openjdk.org/browse/JDK-8190492";,
             JavaUtils.getJavaMajorVersion(), lessThan(11));
 
+        assumeThat("SSLv3 is disabled in JDK-1.8.0u422 by 
https://bugs.openjdk.org/browse/JDK-8190492";,
+            JavaUtils.isJava8Before(422), is(true));
+        
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = SSLv3Test.class.getResource("sslv3-client.xml");
 
@@ -170,7 +174,6 @@ public class SSLv3Test extends 
AbstractBusClientServerTestBase {
         BusFactory.setThreadDefaultBus(bus);
 
         System.setProperty("https.protocols", "SSLv3");
-        System.setProperty("https.cipherSuites", 
"SSL_RSA_WITH_3DES_EDE_CBC_SHA");
 
         URL service = new URL("https://localhost:"; + PORT2);
         HttpsURLConnection connection = (HttpsURLConnection) 
service.openConnection();

Reply via email to