diff --git a/build-parent/pom.xml b/build-parent/pom.xml
index cf3b71bab573fe..98f0268716e6cf 100644
--- a/build-parent/pom.xml
+++ b/build-parent/pom.xml
@@ -115,7 +115,6 @@
2.0.0
0.44.0
3.7.0
- 3.0.0
0.14.7
diff --git a/integration-tests/rest-client-reactive/pom.xml b/integration-tests/rest-client-reactive/pom.xml
index 8d2eeded7d8d03..e43d6511675676 100644
--- a/integration-tests/rest-client-reactive/pom.xml
+++ b/integration-tests/rest-client-reactive/pom.xml
@@ -11,15 +11,6 @@
quarkus-integration-test-rest-client-reactive
Quarkus - Integration Tests - REST Client Reactive
-
- ${project.build.directory}/self-signed.p12
- changeit
- ${project.build.directory}/wrong-host.p12
- changeit
-
-
-
-
@@ -84,6 +75,11 @@
wiremock-standalone
test
+
+ io.smallrye.certs
+ smallrye-certificate-generator
+ test
+
@@ -159,48 +155,6 @@
-
-
- uk.co.automatictester
- truststore-maven-plugin
- ${truststore-maven-plugin.version}
-
-
- self-signed-truststore
- generate-test-resources
-
- generate-truststore
-
-
- PKCS12
- ${self-signed.trust-store}
- ${self-signed.trust-store-password}
-
- self-signed.badssl.com:443
-
- true
- LEAF
-
-
-
- wrong-host-truststore
- generate-test-resources
-
- generate-truststore
-
-
- PKCS12
- ${wrong-host.trust-store}
- ${wrong-host.trust-store-password}
-
- wrong.host.badssl.com:443
-
- true
- LEAF
-
-
-
-
diff --git a/integration-tests/rest-client-reactive/src/main/java/io/quarkus/it/rest/client/main/selfsigned/ExternalSelfSignedClient.java b/integration-tests/rest-client-reactive/src/main/java/io/quarkus/it/rest/client/main/selfsigned/ExternalSelfSignedClient.java
index 8f68088b3064b1..f421b9d6ab7539 100644
--- a/integration-tests/rest-client-reactive/src/main/java/io/quarkus/it/rest/client/main/selfsigned/ExternalSelfSignedClient.java
+++ b/integration-tests/rest-client-reactive/src/main/java/io/quarkus/it/rest/client/main/selfsigned/ExternalSelfSignedClient.java
@@ -6,7 +6,7 @@
import org.eclipse.microprofile.faulttolerance.Retry;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
-@RegisterRestClient(baseUri = "https://self-signed.badssl.com/", configKey = "self-signed")
+@RegisterRestClient(baseUri = "http://not-available", configKey = "self-signed")
public interface ExternalSelfSignedClient {
@GET
diff --git a/integration-tests/rest-client-reactive/src/main/resources/application.properties b/integration-tests/rest-client-reactive/src/main/resources/application.properties
index 293b842b23b7f9..f8c5070ef3a4c6 100644
--- a/integration-tests/rest-client-reactive/src/main/resources/application.properties
+++ b/integration-tests/rest-client-reactive/src/main/resources/application.properties
@@ -5,16 +5,6 @@ correlation/mp-rest/url=${test.url}
io.quarkus.it.rest.client.main.ParamClient/mp-rest/url=${test.url}
# global client logging scope
quarkus.rest-client.logging.scope=request-response
-# Self-Signed client
-quarkus.rest-client.self-signed.trust-store=${self-signed.trust-store}
-quarkus.rest-client.self-signed.trust-store-password=${self-signed.trust-store-password}
-# Wrong Host client (connection accepted, as host verification is turned off)
-quarkus.rest-client.wrong-host.trust-store=${wrong-host.trust-store}
-quarkus.rest-client.wrong-host.trust-store-password=${wrong-host.trust-store-password}
-quarkus.rest-client.wrong-host.verify-host=false
-# Wrong Host client verified (connection rejected, as host verification is turned on by default)
-quarkus.rest-client.wrong-host-rejected.trust-store=${wrong-host.trust-store}
-quarkus.rest-client.wrong-host-rejected.trust-store-password=${wrong-host.trust-store-password}
# speed up build
quarkus.otel.bsp.schedule.delay=100
diff --git a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java
index 1348f532290fc9..c8e3aa91bc7b3d 100644
--- a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java
+++ b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java
@@ -5,9 +5,13 @@
import org.junit.jupiter.api.Test;
+import io.quarkus.it.rest.client.wronghost.BadHostServiceTestResource;
+import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
+@WithTestResource(SelfSignedServiceTestResource.class)
+@WithTestResource(BadHostServiceTestResource.class)
public class ExternalSelfSignedTestCase {
@Test
diff --git a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/SelfSignedServiceTestResource.java b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/SelfSignedServiceTestResource.java
new file mode 100644
index 00000000000000..2e2a23ba5eb9f9
--- /dev/null
+++ b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/selfsigned/SelfSignedServiceTestResource.java
@@ -0,0 +1,58 @@
+package io.quarkus.it.rest.client.selfsigned;
+
+import java.io.File;
+import java.time.Duration;
+import java.util.Map;
+
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import io.smallrye.certs.CertificateGenerator;
+import io.smallrye.certs.CertificateRequest;
+import io.smallrye.certs.Format;
+import io.vertx.core.Vertx;
+import io.vertx.core.http.HttpServerOptions;
+import io.vertx.core.net.PfxOptions;
+
+public class SelfSignedServiceTestResource implements QuarkusTestResourceLifecycleManager {
+
+ Vertx vertx = Vertx.vertx();
+
+ @Override
+ public Map start() {
+ File file = new File("target/certs");
+ file.mkdirs();
+ // Generate self-signed certificate
+ // We do not use the junit 5 plugin to avoid having to annotate all the tests to make sure the certs are
+ // generated before the tests are run
+ CertificateGenerator generator = new CertificateGenerator(file.toPath(), false);
+ CertificateRequest cr = new CertificateRequest()
+ .withName("self-signed")
+ .withFormat(Format.PKCS12)
+ .withPassword("changeit")
+ .withDuration(Duration.ofDays(2))
+ .withCN("localhost");
+ try {
+ generator.generate(cr);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ HttpServerOptions options = new HttpServerOptions()
+ .setSsl(true)
+ .setKeyCertOptions(new PfxOptions()
+ .setPath("target/certs/self-signed-keystore.p12")
+ .setPassword("changeit"));
+ var server = vertx.createHttpServer(options)
+ .requestHandler(req -> req.response().end("OK"))
+ .listen(-2).toCompletionStage().toCompletableFuture().join();
+
+ return Map.of(
+ "quarkus.rest-client.self-signed.url", "https://localhost:" + server.actualPort() + "/",
+ "quarkus.rest-client.self-signed.trust-store", "target/certs/self-signed-truststore.p12",
+ "quarkus.rest-client.self-signed.trust-store-password", "changeit");
+ }
+
+ @Override
+ public void stop() {
+ vertx.close().toCompletionStage().toCompletableFuture().join();
+ }
+}
diff --git a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/BadHostServiceTestResource.java b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/BadHostServiceTestResource.java
new file mode 100644
index 00000000000000..163b2f94f49856
--- /dev/null
+++ b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/BadHostServiceTestResource.java
@@ -0,0 +1,68 @@
+package io.quarkus.it.rest.client.wronghost;
+
+import java.io.File;
+import java.time.Duration;
+import java.util.Map;
+
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import io.smallrye.certs.CertificateGenerator;
+import io.smallrye.certs.CertificateRequest;
+import io.smallrye.certs.Format;
+import io.vertx.core.Vertx;
+import io.vertx.core.http.HttpServerOptions;
+import io.vertx.core.net.PfxOptions;
+
+public class BadHostServiceTestResource implements QuarkusTestResourceLifecycleManager {
+
+ Vertx vertx = Vertx.vertx();
+
+ @Override
+ public Map start() {
+ File file = new File("target/certs");
+ file.mkdirs();
+ // Generate self-signed certificate
+ // We do not use the junit 5 plugin to avoid having to annotate all the tests to make sure the certs are
+ // generated before the tests are run
+ CertificateGenerator generator = new CertificateGenerator(file.toPath(), false);
+ CertificateRequest cr = new CertificateRequest()
+ .withName("bad-host")
+ .withFormat(Format.PKCS12)
+ .withPassword("changeit")
+ .withDuration(Duration.ofDays(2))
+ .withCN("bad-host.com")
+ .withSubjectAlternativeName("DNS:bad-host.com");
+ try {
+ generator.generate(cr);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ File f = new File("target/certs/bad-host-keystore.p12");
+ System.out.println(f.getAbsolutePath() + " / " + f.exists());
+ HttpServerOptions options = new HttpServerOptions()
+ .setSsl(true)
+ .setKeyCertOptions(new PfxOptions()
+ .setPath("target/certs/bad-host-keystore.p12")
+ .setPassword("changeit"));
+ var server = vertx.createHttpServer(options)
+ .requestHandler(req -> req.response().end("OK"))
+ .listen(-1).toCompletionStage().toCompletableFuture().join();
+
+ return Map.of(
+ // Wrong Host client (connection accepted, as host verification is turned off)
+ "quarkus.rest-client.wrong-host.url", "https://localhost:" + server.actualPort() + "/",
+ "quarkus.rest-client.wrong-host.trust-store", "target/certs/bad-host-truststore.p12",
+ "quarkus.rest-client.wrong-host.trust-store-password", "changeit",
+ "quarkus.rest-client.wrong-host.verify-host", "false",
+
+ // Wrong Host client verified (connection rejected, as host verification is turned on by default)
+ "quarkus.rest-client.wrong-host-rejected.url", "https://localhost:" + server.actualPort() + "/",
+ "quarkus.rest-client.wrong-host-rejected.trust-store", "target/certs/bad-host-truststore.p12",
+ "quarkus.rest-client.wrong-host-rejected.trust-store-password", "changeit");
+ }
+
+ @Override
+ public void stop() {
+ vertx.close().toCompletionStage().toCompletableFuture().join();
+ }
+}
diff --git a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestCase.java b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestCase.java
index 838cea76d07c33..09878793177476 100644
--- a/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestCase.java
+++ b/integration-tests/rest-client-reactive/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestCase.java
@@ -6,9 +6,13 @@
import org.junit.jupiter.api.Test;
+import io.quarkus.it.rest.client.selfsigned.SelfSignedServiceTestResource;
+import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
+@WithTestResource(SelfSignedServiceTestResource.class)
+@WithTestResource(BadHostServiceTestResource.class)
public class ExternalWrongHostTestCase {
@Test
public void restClient() {
diff --git a/integration-tests/rest-client/pom.xml b/integration-tests/rest-client/pom.xml
index 8d8eff6503924b..7e2bc53e486588 100644
--- a/integration-tests/rest-client/pom.xml
+++ b/integration-tests/rest-client/pom.xml
@@ -1,7 +1,7 @@
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
quarkus-integration-tests-parent
io.quarkus
@@ -12,10 +12,8 @@
Quarkus - Integration Tests - REST client
- ${project.build.directory}/self-signed.p12
+ ${project.build.directory}/certs/self-signed-keystore.p12
changeit
- ${project.build.directory}/wrong-host.p12
- changeit
@@ -67,6 +65,11 @@
rest-assured
test
+
+ io.smallrye.certs
+ smallrye-certificate-generator
+ test
+
@@ -142,49 +145,6 @@
-
-
- uk.co.automatictester
- truststore-maven-plugin
- ${truststore-maven-plugin.version}
-
-
- self-signed-truststore
- generate-test-resources
-
- generate-truststore
-
-
- PKCS12
- ${self-signed.trust-store}
- ${self-signed.trust-store-password}
-
- self-signed.badssl.com:443
-
- true
- LEAF
-
-
-
- wrong-host-truststore
- generate-test-resources
-
- generate-truststore
-
-
- PKCS12
- ${wrong-host.trust-store}
- ${wrong-host.trust-store-password}
-
- wrong.host.badssl.com:443
-
- true
- LEAF
-
-
-
-
-
org.apache.maven.plugins
maven-surefire-plugin
@@ -193,9 +153,8 @@
en
${self-signed.trust-store}
- ${self-signed.trust-store-password}
- ${wrong-host.trust-store}
- ${wrong-host.trust-store-password}
+ ${self-signed.trust-store-password}
+
@@ -213,8 +172,6 @@
true
- -J-Djavax.net.ssl.trustStore=${self-signed.trust-store},
- -J-Djavax.net.ssl.trustStorePassword=${self-signed.trust-store-password}
@@ -225,8 +182,6 @@
en
- ${wrong-host.trust-store}
- ${wrong-host.trust-store-password}
diff --git a/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedClient.java b/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedClient.java
index 4dd6d3d5af6af1..ece92c79151c2f 100644
--- a/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedClient.java
+++ b/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedClient.java
@@ -6,7 +6,7 @@
import org.eclipse.microprofile.faulttolerance.Retry;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
-@RegisterRestClient(baseUri = "https://self-signed.badssl.com/", configKey = "self-signed")
+@RegisterRestClient(configKey = "self-signed")
public interface ExternalSelfSignedClient {
@GET
diff --git a/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedResource.java b/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedResource.java
index 4bfd0c3b296b65..97b8847e67b545 100644
--- a/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedResource.java
+++ b/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedResource.java
@@ -1,9 +1,6 @@
package io.quarkus.it.rest.client.selfsigned;
import java.io.IOException;
-import java.net.URL;
-
-import javax.net.ssl.HttpsURLConnection;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
@@ -30,29 +27,4 @@ public String perform() throws IOException {
return String.valueOf(client.invoke().getStatus());
}
- @GET
- @Path("/java")
- @Produces(MediaType.TEXT_PLAIN)
- public String invokeJavaURLWithDefaultTruststore() throws IOException {
- try {
- return doGetCipher();
- } catch (IOException e) {
- // if it fails it might be because the remote service is down, so sleep and try again
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ignored) {
- }
- return doGetCipher();
- }
- }
-
- private String doGetCipher() throws IOException {
- // this URL provides an always on example of an HTTPS URL utilizing self-signed certificate
- URL url = new URL("https://self-signed.badssl.com/");
- HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
- con.setRequestMethod("GET");
- con.getResponseCode();
- return con.getCipherSuite();
- }
-
}
diff --git a/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/wronghost/WrongHostClient.java b/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/wronghost/WrongHostClient.java
index 1cb45fd029dda5..7060d3d28a144e 100644
--- a/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/wronghost/WrongHostClient.java
+++ b/integration-tests/rest-client/src/main/java/io/quarkus/it/rest/client/wronghost/WrongHostClient.java
@@ -8,7 +8,7 @@
import org.eclipse.microprofile.faulttolerance.Retry;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
-@RegisterRestClient(baseUri = "https://wrong.host.badssl.com/", configKey = "wrong-host")
+@RegisterRestClient(configKey = "wrong-host")
public interface WrongHostClient {
@GET
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java
index a181c9e615990e..59d1acfcf74c0e 100644
--- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/ExternalSelfSignedTestCase.java
@@ -1,15 +1,15 @@
package io.quarkus.it.rest.client.selfsigned;
import static io.restassured.RestAssured.when;
-import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
import org.junit.jupiter.api.Test;
+import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
+@WithTestResource(SelfSignedServiceTestResource.class)
public class ExternalSelfSignedTestCase {
@Test
@@ -21,12 +21,4 @@ public void should_accept_self_signed_certs() {
.body(is("200"));
}
- @Test
- public void should_accept_self_signed_certs_java_url() {
- when()
- .get("/self-signed/java")
- .then()
- .statusCode(200)
- .body(is(not(empty())));
- }
}
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/SelfSignedServiceTestResource.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/SelfSignedServiceTestResource.java
new file mode 100644
index 00000000000000..2e2a23ba5eb9f9
--- /dev/null
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/selfsigned/SelfSignedServiceTestResource.java
@@ -0,0 +1,58 @@
+package io.quarkus.it.rest.client.selfsigned;
+
+import java.io.File;
+import java.time.Duration;
+import java.util.Map;
+
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import io.smallrye.certs.CertificateGenerator;
+import io.smallrye.certs.CertificateRequest;
+import io.smallrye.certs.Format;
+import io.vertx.core.Vertx;
+import io.vertx.core.http.HttpServerOptions;
+import io.vertx.core.net.PfxOptions;
+
+public class SelfSignedServiceTestResource implements QuarkusTestResourceLifecycleManager {
+
+ Vertx vertx = Vertx.vertx();
+
+ @Override
+ public Map start() {
+ File file = new File("target/certs");
+ file.mkdirs();
+ // Generate self-signed certificate
+ // We do not use the junit 5 plugin to avoid having to annotate all the tests to make sure the certs are
+ // generated before the tests are run
+ CertificateGenerator generator = new CertificateGenerator(file.toPath(), false);
+ CertificateRequest cr = new CertificateRequest()
+ .withName("self-signed")
+ .withFormat(Format.PKCS12)
+ .withPassword("changeit")
+ .withDuration(Duration.ofDays(2))
+ .withCN("localhost");
+ try {
+ generator.generate(cr);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ HttpServerOptions options = new HttpServerOptions()
+ .setSsl(true)
+ .setKeyCertOptions(new PfxOptions()
+ .setPath("target/certs/self-signed-keystore.p12")
+ .setPassword("changeit"));
+ var server = vertx.createHttpServer(options)
+ .requestHandler(req -> req.response().end("OK"))
+ .listen(-2).toCompletionStage().toCompletableFuture().join();
+
+ return Map.of(
+ "quarkus.rest-client.self-signed.url", "https://localhost:" + server.actualPort() + "/",
+ "quarkus.rest-client.self-signed.trust-store", "target/certs/self-signed-truststore.p12",
+ "quarkus.rest-client.self-signed.trust-store-password", "changeit");
+ }
+
+ @Override
+ public void stop() {
+ vertx.close().toCompletionStage().toCompletableFuture().join();
+ }
+}
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/BadHostServiceTestResource.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/BadHostServiceTestResource.java
new file mode 100644
index 00000000000000..206702bec5eb07
--- /dev/null
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/BadHostServiceTestResource.java
@@ -0,0 +1,56 @@
+package io.quarkus.it.rest.client.trustall;
+
+import java.io.File;
+import java.time.Duration;
+import java.util.Map;
+
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import io.smallrye.certs.CertificateGenerator;
+import io.smallrye.certs.CertificateRequest;
+import io.smallrye.certs.Format;
+import io.vertx.core.Vertx;
+import io.vertx.core.http.HttpServerOptions;
+import io.vertx.core.net.PfxOptions;
+
+public class BadHostServiceTestResource implements QuarkusTestResourceLifecycleManager {
+
+ Vertx vertx = Vertx.vertx();
+
+ @Override
+ public Map start() {
+ File file = new File("target/certs");
+ file.mkdirs();
+ // Generate self-signed certificate
+ // We do not use the junit 5 plugin to avoid having to annotate all the tests to make sure the certs are
+ // generated before the tests are run
+ CertificateGenerator generator = new CertificateGenerator(file.toPath(), false);
+ CertificateRequest cr = new CertificateRequest()
+ .withName("bad-host")
+ .withFormat(Format.PKCS12)
+ .withPassword("changeit")
+ .withDuration(Duration.ofDays(2))
+ .withCN("bad-host.com")
+ .withSubjectAlternativeName("DNS:bad-host.com");
+ try {
+ generator.generate(cr);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ HttpServerOptions options = new HttpServerOptions()
+ .setSsl(true)
+ .setKeyCertOptions(new PfxOptions()
+ .setPath("target/certs/bad-host-keystore.p12")
+ .setPassword("changeit"));
+ var server = vertx.createHttpServer(options)
+ .requestHandler(req -> req.response().end("OK"))
+ .listen(-1).toCompletionStage().toCompletableFuture().join();
+
+ return Map.of("wrong-host/mp-rest/url", "https://localhost:" + server.actualPort() + "/");
+ }
+
+ @Override
+ public void stop() {
+ vertx.close().toCompletionStage().toCompletableFuture().join();
+ }
+}
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestCase.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestCase.java
index 533a60ee460a8b..8c1f35ffdfa414 100644
--- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestCase.java
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestCase.java
@@ -5,13 +5,12 @@
import org.junit.jupiter.api.Test;
-import io.quarkus.it.rest.client.wronghost.ExternalWrongHostTestResourceUsingHostnameVerifier;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
+@WithTestResource(BadHostServiceTestResource.class)
@WithTestResource(value = ExternalTlsTrustAllTestResource.class, restrictToAnnotatedClass = false)
-@WithTestResource(ExternalWrongHostTestResourceUsingHostnameVerifier.class)
public class ExternalTlsTrustAllTestCase {
@Test
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestResource.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestResource.java
index 2a55b750ba3f76..7ca39d2217ece3 100644
--- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestResource.java
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/trustall/ExternalTlsTrustAllTestResource.java
@@ -10,9 +10,9 @@ public class ExternalTlsTrustAllTestResource implements QuarkusTestResourceLifec
@Override
public Map start() {
Map result = new HashMap<>();
- result.put("wrong-host/mp-rest/trustStore", System.getProperty("rest-client.trustStore"));
- result.put("wrong-host/mp-rest/trustStorePassword", System.getProperty("rest-client.trustStorePassword"));
- result.put("quarkus.tls.trust-all", "true");
+ result.put("wrong-host/mp-rest/trustStore", "target/certs/bad-host-truststore.p12");
+ result.put("wrong-host/mp-rest/trustStorePassword", "changeit");
+ result.put("wrong-host/mp-rest/verifyHost", Boolean.FALSE.toString());
return result;
}
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/BaseExternalWrongHostTestCase.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/BaseExternalWrongHostTestCase.java
index 3a9f7e5f73f3a0..fac81fa718ded1 100644
--- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/BaseExternalWrongHostTestCase.java
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/BaseExternalWrongHostTestCase.java
@@ -22,6 +22,6 @@ public void restClient() {
.then()
.statusCode(200)
.body(containsString(
- "http_client_requests_seconds_count{clientName=\"wrong.host.badssl.com\",method=\"GET\",outcome=\"SUCCESS\",status=\"200\",uri=\"root\"}"));
+ "http_client_requests_seconds_count{clientName=\"localhost\",method=\"GET\",outcome=\"SUCCESS\",status=\"200\",uri=\"root\"}"));
}
}
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestResourceUsingHostnameVerifier.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestResourceUsingHostnameVerifier.java
index e9f7cfe023c9ed..c06a9322cc639d 100644
--- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestResourceUsingHostnameVerifier.java
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestResourceUsingHostnameVerifier.java
@@ -14,8 +14,8 @@ public class ExternalWrongHostTestResourceUsingHostnameVerifier implements Quark
@Override
public Map start() {
Map result = new HashMap<>();
- result.put("wrong-host/mp-rest/trustStore", System.getProperty("rest-client.trustStore"));
- result.put("wrong-host/mp-rest/trustStorePassword", System.getProperty("rest-client.trustStorePassword"));
+ result.put("wrong-host/mp-rest/trustStore", "target/certs/bad-host-truststore.p12");
+ result.put("wrong-host/mp-rest/trustStorePassword", "changeit");
result.put("wrong-host/mp-rest/hostnameVerifier", NoopHostnameVerifier.class.getName());
return result;
}
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestResourceUsingVerifyHost.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestResourceUsingVerifyHost.java
index 8ee70c21f8db0e..5854587f92f610 100644
--- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestResourceUsingVerifyHost.java
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostTestResourceUsingVerifyHost.java
@@ -13,8 +13,8 @@ public class ExternalWrongHostTestResourceUsingVerifyHost implements QuarkusTest
@Override
public Map start() {
Map result = new HashMap<>();
- result.put("wrong-host/mp-rest/trustStore", System.getProperty("rest-client.trustStore"));
- result.put("wrong-host/mp-rest/trustStorePassword", System.getProperty("rest-client.trustStorePassword"));
+ result.put("wrong-host/mp-rest/trustStore", "target/certs/bad-host-truststore.p12");
+ result.put("wrong-host/mp-rest/trustStorePassword", "changeit");
result.put("wrong-host/mp-rest/verifyHost", Boolean.FALSE.toString());
return result;
}
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingHostnameVerifierTestCase.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingHostnameVerifierTestCase.java
index e1e9fd01482dc0..2d70f7da279c73 100644
--- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingHostnameVerifierTestCase.java
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingHostnameVerifierTestCase.java
@@ -1,9 +1,11 @@
package io.quarkus.it.rest.client.wronghost;
+import io.quarkus.it.rest.client.trustall.BadHostServiceTestResource;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
+@WithTestResource(BadHostServiceTestResource.class)
@WithTestResource(ExternalWrongHostTestResourceUsingHostnameVerifier.class)
public class ExternalWrongHostUsingHostnameVerifierTestCase extends BaseExternalWrongHostTestCase {
}
diff --git a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingVerifyHostTestCase.java b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingVerifyHostTestCase.java
index 0eac789caf5784..bfd50dcb3e1ab1 100644
--- a/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingVerifyHostTestCase.java
+++ b/integration-tests/rest-client/src/test/java/io/quarkus/it/rest/client/wronghost/ExternalWrongHostUsingVerifyHostTestCase.java
@@ -1,9 +1,11 @@
package io.quarkus.it.rest.client.wronghost;
+import io.quarkus.it.rest.client.trustall.BadHostServiceTestResource;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
+@WithTestResource(BadHostServiceTestResource.class)
@WithTestResource(ExternalWrongHostTestResourceUsingVerifyHost.class)
public class ExternalWrongHostUsingVerifyHostTestCase extends BaseExternalWrongHostTestCase {
}