From 8a2bd7045e1c5c3241f0bc30ec2b1834194c835b Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Tue, 21 Jan 2025 08:53:39 +0100 Subject: [PATCH 1/2] Adjust comment for about ALPN and JDK 8/11 --- .../java/io/quarkus/vertx/http/runtime/HttpConfiguration.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/HttpConfiguration.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/HttpConfiguration.java index 1dc81ee6a927b..5300063b6d072 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/HttpConfiguration.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/HttpConfiguration.java @@ -103,9 +103,7 @@ public class HttpConfiguration { /** * If this is true (the default) then HTTP/2 will be enabled. *

- * Note that for browsers to be able to use it HTTPS must be enabled, - * and you must be running on JDK11 or above, as JDK8 does not support - * ALPN. + * Note that for browsers to be able to use it HTTPS must be enabled. */ @ConfigItem(defaultValue = "true") public boolean http2; From efd4732f216ffe911d3e62d26254598788a3858c Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Tue, 21 Jan 2025 08:54:54 +0100 Subject: [PATCH 2/2] Drop assumes for isAlpnAvailable in tests --- .../io/quarkus/undertow/test/push/Http2ServerPushTestCase.java | 3 --- .../vertx/http/http2/Http2RSTFloodProtectionConfigTest.java | 3 --- .../quarkus/vertx/http/http2/Http2RSTFloodProtectionTest.java | 3 --- .../src/test/java/io/quarkus/vertx/http/http2/Http2Test.java | 3 --- .../vertx/http/http2/Http2WithNamedConfigTlsRegistryTest.java | 3 --- .../io/quarkus/vertx/http/http2/Http2WithTlsRegistryTest.java | 3 --- .../java/io/quarkus/it/rest/client/http2/ResourceTest.java | 3 --- .../src/test/java/io/quarkus/it/vertx/Http2TestCase.java | 3 --- 8 files changed, 24 deletions(-) diff --git a/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/push/Http2ServerPushTestCase.java b/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/push/Http2ServerPushTestCase.java index 22dada98aa513..49bd64923513e 100644 --- a/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/push/Http2ServerPushTestCase.java +++ b/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/push/Http2ServerPushTestCase.java @@ -10,7 +10,6 @@ import java.util.function.Function; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -26,7 +25,6 @@ import io.vertx.core.http.HttpClientResponse; import io.vertx.core.http.HttpMethod; import io.vertx.core.http.HttpVersion; -import io.vertx.core.net.JdkSSLEngineOptions; public class Http2ServerPushTestCase { @@ -42,7 +40,6 @@ public class Http2ServerPushTestCase { @Test public void testServerPush() throws Exception { - Assumptions.assumeTrue(JdkSSLEngineOptions.isAlpnAvailable()); //don't run on JDK8 Vertx vertx = Vertx.vertx(); try { HttpClientOptions options = new HttpClientOptions().setSsl(true).setUseAlpn(true) diff --git a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2RSTFloodProtectionConfigTest.java b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2RSTFloodProtectionConfigTest.java index a44d1329999fd..31ded4d0f0406 100644 --- a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2RSTFloodProtectionConfigTest.java +++ b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2RSTFloodProtectionConfigTest.java @@ -13,7 +13,6 @@ import org.jboss.shrinkwrap.api.asset.StringAsset; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.condition.OS; @@ -29,7 +28,6 @@ import io.vertx.core.http.HttpClientOptions; import io.vertx.core.http.HttpClientRequest; import io.vertx.core.http.HttpVersion; -import io.vertx.core.net.JdkSSLEngineOptions; import io.vertx.core.net.JksOptions; import io.vertx.ext.web.Router; @@ -64,7 +62,6 @@ public class Http2RSTFloodProtectionConfigTest { @Test void testRstFloodProtectionWithTlsEnabled() throws Exception { - Assumptions.assumeTrue(JdkSSLEngineOptions.isAlpnAvailable()); //don't run on JDK8 HttpClientOptions options = new HttpClientOptions() .setUseAlpn(true) .setProtocolVersion(HttpVersion.HTTP_2) diff --git a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2RSTFloodProtectionTest.java b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2RSTFloodProtectionTest.java index 31020ed457241..efdde1794f432 100644 --- a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2RSTFloodProtectionTest.java +++ b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2RSTFloodProtectionTest.java @@ -13,7 +13,6 @@ import org.jboss.shrinkwrap.api.asset.StringAsset; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnOs; import org.junit.jupiter.api.condition.OS; @@ -29,7 +28,6 @@ import io.vertx.core.http.HttpClientOptions; import io.vertx.core.http.HttpClientRequest; import io.vertx.core.http.HttpVersion; -import io.vertx.core.net.JdkSSLEngineOptions; import io.vertx.core.net.JksOptions; import io.vertx.ext.web.Router; @@ -61,7 +59,6 @@ public class Http2RSTFloodProtectionTest { @Test void testRstFloodProtectionWithTlsEnabled() throws Exception { - Assumptions.assumeTrue(JdkSSLEngineOptions.isAlpnAvailable()); //don't run on JDK8 HttpClientOptions options = new HttpClientOptions() .setUseAlpn(true) .setProtocolVersion(HttpVersion.HTTP_2) diff --git a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2Test.java b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2Test.java index bd729000cdaed..181eeb4febbb8 100644 --- a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2Test.java +++ b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2Test.java @@ -9,7 +9,6 @@ import jakarta.enterprise.event.Observes; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -23,7 +22,6 @@ import io.vertx.core.Handler; import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpVersion; -import io.vertx.core.net.JdkSSLEngineOptions; import io.vertx.core.net.JksOptions; import io.vertx.ext.web.Router; import io.vertx.ext.web.client.HttpResponse; @@ -52,7 +50,6 @@ public class Http2Test { @Test public void testHttp2EnabledSsl() throws ExecutionException, InterruptedException { - Assumptions.assumeTrue(JdkSSLEngineOptions.isAlpnAvailable()); //don't run on JDK8 WebClientOptions options = new WebClientOptions() .setUseAlpn(true) .setProtocolVersion(HttpVersion.HTTP_2) diff --git a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2WithNamedConfigTlsRegistryTest.java b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2WithNamedConfigTlsRegistryTest.java index cab362542d56b..2d14a4215502b 100644 --- a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2WithNamedConfigTlsRegistryTest.java +++ b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2WithNamedConfigTlsRegistryTest.java @@ -9,7 +9,6 @@ import jakarta.enterprise.event.Observes; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -23,7 +22,6 @@ import io.vertx.core.Handler; import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpVersion; -import io.vertx.core.net.JdkSSLEngineOptions; import io.vertx.core.net.JksOptions; import io.vertx.ext.web.Router; import io.vertx.ext.web.client.HttpResponse; @@ -52,7 +50,6 @@ public class Http2WithNamedConfigTlsRegistryTest { @Test public void testHttp2EnabledTls() throws ExecutionException, InterruptedException { - Assumptions.assumeTrue(JdkSSLEngineOptions.isAlpnAvailable()); //don't run on JDK8 WebClientOptions options = new WebClientOptions() .setUseAlpn(true) .setProtocolVersion(HttpVersion.HTTP_2) diff --git a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2WithTlsRegistryTest.java b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2WithTlsRegistryTest.java index 54eafbeb13ef8..1c4cbc39e5f56 100644 --- a/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2WithTlsRegistryTest.java +++ b/extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/http2/Http2WithTlsRegistryTest.java @@ -9,7 +9,6 @@ import jakarta.enterprise.event.Observes; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -23,7 +22,6 @@ import io.vertx.core.Handler; import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpVersion; -import io.vertx.core.net.JdkSSLEngineOptions; import io.vertx.core.net.JksOptions; import io.vertx.ext.web.Router; import io.vertx.ext.web.client.HttpResponse; @@ -52,7 +50,6 @@ public class Http2WithTlsRegistryTest { @Test public void testHttp2EnabledTls() throws ExecutionException, InterruptedException { - Assumptions.assumeTrue(JdkSSLEngineOptions.isAlpnAvailable()); //don't run on JDK8 WebClientOptions options = new WebClientOptions() .setUseAlpn(true) .setProtocolVersion(HttpVersion.HTTP_2) diff --git a/integration-tests/rest-client-reactive-http2/src/test/java/io/quarkus/it/rest/client/http2/ResourceTest.java b/integration-tests/rest-client-reactive-http2/src/test/java/io/quarkus/it/rest/client/http2/ResourceTest.java index 3c8c025345872..84e80b3f09af4 100644 --- a/integration-tests/rest-client-reactive-http2/src/test/java/io/quarkus/it/rest/client/http2/ResourceTest.java +++ b/integration-tests/rest-client-reactive-http2/src/test/java/io/quarkus/it/rest/client/http2/ResourceTest.java @@ -6,7 +6,6 @@ import java.util.concurrent.CompletableFuture; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -15,7 +14,6 @@ import io.vertx.core.Vertx; import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpVersion; -import io.vertx.core.net.JdkSSLEngineOptions; import io.vertx.ext.web.client.HttpResponse; import io.vertx.ext.web.client.WebClient; import io.vertx.ext.web.client.WebClientOptions; @@ -81,7 +79,6 @@ private HttpResponse call(URL url) throws Exception { } private WebClient createWebClient() { - Assumptions.assumeTrue(JdkSSLEngineOptions.isAlpnAvailable()); //don't run on JDK8 Vertx vertx = Vertx.vertx(); WebClientOptions options = new WebClientOptions() .setUseAlpn(true) diff --git a/integration-tests/vertx-http/src/test/java/io/quarkus/it/vertx/Http2TestCase.java b/integration-tests/vertx-http/src/test/java/io/quarkus/it/vertx/Http2TestCase.java index 58ccc474cd1d3..5d4d2973de190 100644 --- a/integration-tests/vertx-http/src/test/java/io/quarkus/it/vertx/Http2TestCase.java +++ b/integration-tests/vertx-http/src/test/java/io/quarkus/it/vertx/Http2TestCase.java @@ -9,7 +9,6 @@ import org.apache.commons.lang3.exception.ExceptionUtils; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import io.quarkus.test.common.http.TestHTTPResource; @@ -19,7 +18,6 @@ import io.vertx.core.Vertx; import io.vertx.core.buffer.Buffer; import io.vertx.core.http.HttpVersion; -import io.vertx.core.net.JdkSSLEngineOptions; import io.vertx.core.net.JksOptions; import io.vertx.ext.web.Router; import io.vertx.ext.web.client.HttpResponse; @@ -54,7 +52,6 @@ public void testHttp2EnabledSslWithNotSelectedClientCert() throws ExecutionExcep } private void runHttp2EnabledSsl(String keystoreName) throws InterruptedException, ExecutionException { - Assumptions.assumeTrue(JdkSSLEngineOptions.isAlpnAvailable()); //don't run on JDK8 Vertx vertx = Vertx.vertx(); try { WebClientOptions options = new WebClientOptions()