From 31866f43ed15283c2d205920669a5780bb2082b2 Mon Sep 17 00:00:00 2001 From: Phil Barber Date: Mon, 7 Apr 2025 12:55:49 -0400 Subject: [PATCH] Disable TLSv1.3 tests with Java 8 There may be a way to configure Java 8 to use TLSv1.3, but it is not currently working. --- build.gradle | 2 -- .../java/com/marklogic/client/test/ssl/OneWaySSLTest.java | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index afe03ef4d..db245f77d 100644 --- a/build.gradle +++ b/build.gradle @@ -42,8 +42,6 @@ subprojects { test { systemProperty "file.encoding", "UTF-8" systemProperty "javax.xml.stream.XMLOutputFactory", "com.sun.xml.internal.stream.XMLOutputFactoryImpl" - // Java 8 requires the TLSv1.3 be enabled before using it. - systemProperty "jdk.tls.client.protocols", "TLSv1.3,TLSv1.2" } // Until we do a cleanup of javadoc errors, the build (and specifically the javadoc task) fails on Java 11 diff --git a/marklogic-client-api/src/test/java/com/marklogic/client/test/ssl/OneWaySSLTest.java b/marklogic-client-api/src/test/java/com/marklogic/client/test/ssl/OneWaySSLTest.java index d2ce15076..a95a7f471 100644 --- a/marklogic-client-api/src/test/java/com/marklogic/client/test/ssl/OneWaySSLTest.java +++ b/marklogic-client-api/src/test/java/com/marklogic/client/test/ssl/OneWaySSLTest.java @@ -13,6 +13,8 @@ import com.marklogic.mgmt.ManageClient; import com.marklogic.mgmt.resource.appservers.ServerManager; import org.junit.jupiter.api.*; +import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.api.extension.ExtendWith; import javax.net.ssl.SSLContext; @@ -130,6 +132,9 @@ void noSslContext() throws Exception { ); } + // The TLS tests are failing on Java 8, because TLSv1.3 is disabled with our version of Java 8. + // There may be a way to configure Java 8 to use TLSv1.3, but it is not currently working. + @DisabledOnJre(JRE.JAVA_8) @Test void tLS13ClientWithTLS12Server() throws Exception { DatabaseClient client = buildTrustAllClientWithSSLProtocol("TLSv1.3"); @@ -140,6 +145,7 @@ void tLS13ClientWithTLS12Server() throws Exception { } @ExtendWith(RequiresML12.class) + @DisabledOnJre(JRE.JAVA_8) @Test void tLS13ClientWithTLS13Server() throws Exception { setAppServerMinimumTLSVersion("TLSv1.3"); @@ -152,6 +158,7 @@ void tLS13ClientWithTLS13Server() throws Exception { } @ExtendWith(RequiresML12.class) + @DisabledOnJre(JRE.JAVA_8) @Test void tLS12ClientWithTLS13ServerShouldFail() throws Exception { setAppServerMinimumTLSVersion("TLSv1.3");