This is an automated email from the ASF dual-hosted git repository.
zhfeng pushed a commit to branch 3.8.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/3.8.x by this push:
new 8366132771 Test support certificate
8366132771 is described below
commit 83661327711b8e8686c9d04e6cb8bee17e9043f8
Author: JiriOndrusek <[email protected]>
AuthorDate: Wed May 22 10:48:10 2024 +0200
Test support certificate
---
integration-test-groups/http/README.adoc | 7 ---
.../http/common/generate-certs.sh | 67 --------------------
.../component/http/common/CommonProducers.java | 6 +-
.../src/main/resources/application.properties | 4 +-
.../main/resources/jsse/client-truststore.pkcs12 | Bin 2246 -> 0 bytes
.../main/resources/jsse/localhost-keystore.pkcs12 | Bin 3638 -> 0 bytes
.../component/http/common/HttpTestResource.java | 4 ++
integration-test-groups/http/common/v3.ext | 3 -
integration-test-groups/http/http/pom.xml | 5 ++
.../quarkus/component/http/http/it/HttpTest.java | 6 ++
integration-test-groups/http/netty-http/pom.xml | 5 ++
.../component/http/netty/it/NettyHttpJaasTest.java | 7 +++
integration-test-groups/http/vertx-http/pom.xml | 5 ++
.../component/http/vertx/it/VertxHttpTest.java | 6 ++
.../test/support/certificate/CertificatesUtil.java | 18 +++---
.../TestCertificateGenerationExtension.java | 21 +++----
.../test/support/certificate/TestCertificates.java | 9 ++-
integration-tests/ftp/pom.xml | 5 ++
.../quarkus/component/ftp/it/FtpTestResource.java | 21 ++++---
.../camel/quarkus/component/ftps/it/FtpsTest.java | 9 +++
.../component/ftps/it/FtpsTestResource.java | 37 +++--------
.../camel/quarkus/component/sftp/it/SftpTest.java | 8 +++
.../component/sftp/it/SftpTestResource.java | 2 +-
.../ftp/src/test/resources/keystore.p12 | Bin 3542 -> 0 bytes
.../ftp/src/test/resources/readme.adoc | 28 ---------
integration-tests/ftp/src/test/resources/test.key | 28 ---------
integration-tests/http-grouped/pom.xml | 5 ++
.../camel/quarkus/kafka/sasl/KafkaSaslSslTest.java | 2 +-
.../camel/quarkus/kafka/ssl/KafkaSslTest.java | 2 +-
integration-tests/lumberjack/pom.xml | 5 ++
.../component/lumberjack/it/LumberjackRoutes.java | 2 +-
.../src/main/resources/application.properties | 2 +-
.../lumberjack/src/main/resources/ssl/keystore.jks | Bin 1473 -> 0 bytes
.../lumberjack/it/LumberjackClientUtil.java | 2 +-
.../component/lumberjack/it/LumberjackTest.java | 6 ++
integration-tests/mail/README.adoc | 17 -----
integration-tests/mail/pom.xml | 5 ++
.../camel/quarkus/component/mail/MailTest.java | 9 +++
.../quarkus/component/mail/MailTestResource.java | 69 ++-------------------
.../src/test/resources/generate-certificates.sh | 32 ----------
.../mail/src/test/resources/greenmail.p12 | Bin 4077 -> 0 bytes
integration-tests/nats/pom.xml | 5 ++
.../quarkus/component/nats/it/NatsRoutes.java | 4 +-
.../nats/src/main/resources/application.properties | 2 +-
.../nats/src/main/resources/certs/keystore.jks | Bin 3477 -> 0 bytes
.../nats/src/main/resources/certs/truststore.jks | Bin 1162 -> 0 bytes
.../camel/quarkus/component/nats/it/NatsTest.java | 6 ++
.../component/nats/it/NatsTestResource.java | 13 ++--
.../nats/src/test/resources/certs/ca.pem | 20 ------
.../nats/src/test/resources/certs/key.pem | 28 ---------
.../nats/src/test/resources/certs/server.pem | 20 ------
integration-tests/netty/README.adoc | 16 -----
integration-tests/netty/pom.xml | 44 ++-----------
.../quarkus/component/netty/NettyProducers.java | 8 +--
.../src/main/resources/application.properties | 14 +----
.../src/main/resources/ssl/fips-keystore.bcfks | Bin 2579 -> 0 bytes
.../src/main/resources/ssl/fips-truststore.bcfks | Bin 1188 -> 0 bytes
.../netty/src/main/resources/ssl/keystore.p12 | Bin 2421 -> 0 bytes
.../netty/src/main/resources/ssl/truststore.jks | Bin 1018 -> 0 bytes
.../quarkus/component/netty/tcp/NettyTcpTest.java | 6 ++
.../quarkus/component/netty/udp/NettyUdpTest.java | 6 ++
integration-tests/oaipmh/pom.xml | 5 ++
.../component/oaipmh/it/MockOaipmhServer.java | 4 +-
.../quarkus/component/oaipmh/it/OaipmhTest.java | 6 ++
.../src/test/resources/jettyKS/localhost.p12 | Bin 2533 -> 0 bytes
integration-tests/paho-mqtt5/pom.xml | 5 ++
.../component/paho/mqtt5/it/PahoMqtt5Resource.java | 12 ++--
.../src/main/resources/application.properties | 2 +-
.../src/main/resources/clientkeystore.jks | Bin 2263 -> 0 bytes
.../component/paho/mqtt5/it/PahoMqtt5Test.java | 7 +++
.../paho/mqtt5/it/PahoMqtt5TestResource.java | 8 ++-
.../paho-mqtt5/src/test/resources/certs/ca.key | 30 ---------
.../paho-mqtt5/src/test/resources/certs/ca.pem | 22 -------
.../paho-mqtt5/src/test/resources/certs/server.key | 27 --------
.../paho-mqtt5/src/test/resources/certs/server.pem | 20 ------
.../paho-mqtt5/src/test/resources/mosquitto.conf | 6 +-
integration-tests/paho/pom.xml | 5 ++
.../camel/quarkus/component/paho/PahoResource.java | 6 +-
.../paho/src/main/resources/application.properties | 2 +-
.../paho/src/main/resources/clientkeystore.jks | Bin 2263 -> 0 bytes
.../camel/quarkus/component/paho/it/PahoTest.java | 8 +++
.../component/paho/it/PahoTestResource.java | 11 ++--
.../paho/src/test/resources/certs/ca.key | 30 ---------
.../paho/src/test/resources/certs/ca.pem | 22 -------
.../paho/src/test/resources/certs/server.key | 27 --------
.../paho/src/test/resources/certs/server.pem | 20 ------
.../paho/src/test/resources/mosquitto.conf | 6 +-
integration-tests/platform-http-proxy-ssl/pom.xml | 5 ++
.../platform/http/proxy/ssl/it/Routes.java | 4 +-
.../src/main/resources/application.properties | 2 +-
.../src/main/resources/ssl/keystore.p12 | Bin 2716 -> 0 bytes
.../PlatformHttpSSLTestResource.java | 2 +-
.../ProxySslTest.java | 6 ++
integration-tests/platform-http/README.adoc | 37 -----------
integration-tests/platform-http/ca-openssl.cnf | 18 ------
integration-tests/platform-http/pom.xml | 5 ++
.../src/main/resources/application.properties | 6 +-
.../src/main/resources/server-cert.pem | 20 ------
.../src/main/resources/server-key.pem | 28 ---------
.../component/http/server/it/PlatformHttpTest.java | 8 ++-
.../src/test/resources/truststore.p12 | Bin 1190 -> 0 bytes
integration-tests/vertx-websocket/README.adoc | 15 -----
integration-tests/vertx-websocket/pom.xml | 5 ++
.../vertx/websocket/it/VertxWebsocketResource.java | 2 +-
.../src/main/resources/application.properties | 2 +-
.../src/main/resources/server-cert.pem | 17 -----
.../src/main/resources/server-key.pem | 28 ---------
.../src/main/resources/truststore.p12 | Bin 1046 -> 0 bytes
.../it/VertxWebsocketClientSslProvider.java | 3 +-
.../vertx/websocket/it/VertxWebsocketSslTest.java | 8 ++-
.../websocket/it/VertxWebsocketSslTestProfile.java | 4 +-
111 files changed, 304 insertions(+), 873 deletions(-)
diff --git a/integration-test-groups/http/README.adoc
b/integration-test-groups/http/README.adoc
deleted file mode 100644
index c1154c278e..0000000000
--- a/integration-test-groups/http/README.adoc
+++ /dev/null
@@ -1,7 +0,0 @@
-== Certificate for HTTPS
-
-Server keystore has to contain server certificate.
-
-=== How to generate new keystore and truststore
-
-Delete folder `common/src/main/resources/jsse` and run the script
`common/generate-certs.sh` to generate new keystore and truststore.
diff --git a/integration-test-groups/http/common/generate-certs.sh
b/integration-test-groups/http/common/generate-certs.sh
deleted file mode 100755
index c14febd7cf..0000000000
--- a/integration-test-groups/http/common/generate-certs.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-set -e
-set -x
-
-invocationDir="$(pwd)"
-workDir="target/openssl-work"
-destinationDir="src/main/resources/jsse"
-keySize=2048
-days=10000
-extFile="$(pwd)/v3.ext"
-encryptionAlgo="aes-256-cbc"
-
-if [[ -n "${JAVA_HOME}" ]] ; then
- keytool="$JAVA_HOME/bin/keytool"
-elif ! [[ -x "$(command -v keytool)" ]] ; then
- echo 'Error: Either add keytool to PATH or set JAVA_HOME' >&2
- exit 1
-else
- keytool="keytool"
-fi
-
-if ! [[ -x "$(command -v openssl)" ]] ; then
- echo 'Error: openssl is not installed.' >&2
- exit 1
-fi
-
-mkdir -p "$workDir"
-mkdir -p "$destinationDir"
-
-# Certificate authority
-openssl genrsa -out "$workDir/ca.key" $keySize
-openssl req -x509 -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=ca'
-key "$workDir/ca.key" -nodes -out "$workDir/ca.pem" -days $days -extensions
v3_req
-openssl req -new -subj '/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=ca' -x509
-key "$workDir/ca.key" -days $days -out "$workDir/ca.crt"
-
-for actor in localhost; do
- # Generate keys
- openssl genrsa -out "$workDir/$actor.key" $keySize
-
- # Generate certificates
- openssl req -new -subj "/O=apache.org/OU=eng (NOT FOR PRODUCTION)/CN=$actor"
-key "$workDir/$actor.key" -out "$workDir/$actor.csr"
- openssl x509 -req -in "$workDir/$actor.csr" -extfile "$extFile" -CA
"$workDir/ca.pem" -CAkey "$workDir/ca.key" -CAcreateserial -days $days -out
"$workDir/$actor.crt"
-
- # Export keystores
- openssl pkcs12 -export -in "$workDir/$actor.crt" -inkey
"$workDir/$actor.key" -certfile "$workDir/ca.crt" -name "$actor" -out
"$destinationDir/$actor-keystore.pkcs12" -passout
pass:"${actor}-keystore-password" -keypbe "$encryptionAlgo" -certpbe
"$encryptionAlgo"
-done
-
-
-# Truststore
-"$keytool" -import -file "$workDir/localhost.crt" -alias localhost -noprompt
-keystore "$destinationDir/client-truststore.pkcs12" -storepass
"client-truststore-password"
-"$keytool" -import -file "$workDir/ca.crt" -alias ca -noprompt
-keystore "$destinationDir/client-truststore.pkcs12" -storepass
"client-truststore-password"
diff --git
a/integration-test-groups/http/common/src/main/java/org/apache/camel/quarkus/component/http/common/CommonProducers.java
b/integration-test-groups/http/common/src/main/java/org/apache/camel/quarkus/component/http/common/CommonProducers.java
index 5d172a23de..479a8c911a 100644
---
a/integration-test-groups/http/common/src/main/java/org/apache/camel/quarkus/component/http/common/CommonProducers.java
+++
b/integration-test-groups/http/common/src/main/java/org/apache/camel/quarkus/component/http/common/CommonProducers.java
@@ -27,12 +27,12 @@ public class CommonProducers {
@Named
public SSLContextParameters sslContextParameters() {
KeyStoreParameters keystoreParameters = new KeyStoreParameters();
- keystoreParameters.setResource("/jsse/localhost-keystore.pkcs12");
+ keystoreParameters.setResource("/certs/localhost-keystore.p12");
keystoreParameters.setPassword("localhost-keystore-password");
KeyStoreParameters truststoreParameters = new KeyStoreParameters();
- truststoreParameters.setResource("/jsse/client-truststore.pkcs12");
- truststoreParameters.setPassword("client-truststore-password");
+ truststoreParameters.setResource("/certs/localhost-truststore.p12");
+ truststoreParameters.setPassword("localhost-keystore-password");
TrustManagersParameters trustManagersParameters = new
TrustManagersParameters();
trustManagersParameters.setKeyStore(truststoreParameters);
diff --git
a/integration-test-groups/http/common/src/main/resources/application.properties
b/integration-test-groups/http/common/src/main/resources/application.properties
index 05e3b20242..e99d3e9f96 100644
---
a/integration-test-groups/http/common/src/main/resources/application.properties
+++
b/integration-test-groups/http/common/src/main/resources/application.properties
@@ -18,7 +18,7 @@
#
# Quarkus
#
-quarkus.native.resources.includes = jsse/*,restcountries/*
+quarkus.native.resources.includes = certs/*,restcountries/*
quarkus.native.add-all-charsets = true
quarkus.camel.native.reflection.serialization-enabled = true
@@ -31,7 +31,7 @@ quarkus.security.users.embedded.roles.admin=admin
quarkus.security.users.embedded.roles.noadmin=user
quarkus.http.insecure-requests=enabled
-quarkus.http.ssl.certificate.key-store-file=jsse/localhost-keystore.pkcs12
+quarkus.http.ssl.certificate.key-store-file=certs/localhost-keystore.p12
quarkus.http.ssl.certificate.key-store-password=localhost-keystore-password
quarkus.resteasy.gzip.enabled=true
diff --git
a/integration-test-groups/http/common/src/main/resources/jsse/client-truststore.pkcs12
b/integration-test-groups/http/common/src/main/resources/jsse/client-truststore.pkcs12
deleted file mode 100644
index f5b3fee8d4..0000000000
Binary files
a/integration-test-groups/http/common/src/main/resources/jsse/client-truststore.pkcs12
and /dev/null differ
diff --git
a/integration-test-groups/http/common/src/main/resources/jsse/localhost-keystore.pkcs12
b/integration-test-groups/http/common/src/main/resources/jsse/localhost-keystore.pkcs12
deleted file mode 100644
index ae9c588345..0000000000
Binary files
a/integration-test-groups/http/common/src/main/resources/jsse/localhost-keystore.pkcs12
and /dev/null differ
diff --git
a/integration-test-groups/http/common/src/test/java/org/apache/camel/quarkus/component/http/common/HttpTestResource.java
b/integration-test-groups/http/common/src/test/java/org/apache/camel/quarkus/component/http/common/HttpTestResource.java
index 270e4dfdff..83d36b63a1 100644
---
a/integration-test-groups/http/common/src/test/java/org/apache/camel/quarkus/component/http/common/HttpTestResource.java
+++
b/integration-test-groups/http/common/src/test/java/org/apache/camel/quarkus/component/http/common/HttpTestResource.java
@@ -41,6 +41,10 @@ import static
org.apache.camel.quarkus.component.http.common.AbstractHttpResourc
public class HttpTestResource implements QuarkusTestResourceLifecycleManager {
private static final Logger LOG = Logger.getLogger(HttpTestResource.class);
+
+ public static final String KEYSTORE_NAME = "localhost";
+ public static final String KEYSTORE_PASSWORD =
"localhost-keystore-password";
+
private ProxyServer server;
@Override
diff --git a/integration-test-groups/http/common/v3.ext
b/integration-test-groups/http/common/v3.ext
deleted file mode 100644
index 632d6d3a6f..0000000000
--- a/integration-test-groups/http/common/v3.ext
+++ /dev/null
@@ -1,3 +0,0 @@
-authorityKeyIdentifier = keyid, issuer
-basicConstraints = CA:FALSE
-keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
\ No newline at end of file
diff --git a/integration-test-groups/http/http/pom.xml
b/integration-test-groups/http/http/pom.xml
index b72ed8a0a7..7485ba5d2c 100644
--- a/integration-test-groups/http/http/pom.xml
+++ b/integration-test-groups/http/http/pom.xml
@@ -78,6 +78,11 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
<profile>
diff --git
a/integration-test-groups/http/http/src/test/java/org/apache/camel/quarkus/component/http/http/it/HttpTest.java
b/integration-test-groups/http/http/src/test/java/org/apache/camel/quarkus/component/http/http/it/HttpTest.java
index e7aa79d11f..1f523639b9 100644
---
a/integration-test-groups/http/http/src/test/java/org/apache/camel/quarkus/component/http/http/it/HttpTest.java
+++
b/integration-test-groups/http/http/src/test/java/org/apache/camel/quarkus/component/http/http/it/HttpTest.java
@@ -20,14 +20,20 @@ import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
import org.apache.camel.quarkus.component.http.common.AbstractHttpTest;
import org.apache.camel.quarkus.component.http.common.HttpTestResource;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
+@TestCertificates(certificates = {
+ @Certificate(name = HttpTestResource.KEYSTORE_NAME, formats = {
+ Format.PKCS12 }, password =
HttpTestResource.KEYSTORE_PASSWORD) })
@QuarkusTest
@QuarkusTestResource(HttpTestResource.class)
public class HttpTest extends AbstractHttpTest {
diff --git a/integration-test-groups/http/netty-http/pom.xml
b/integration-test-groups/http/netty-http/pom.xml
index 0e138fdab0..e77ca97dfe 100644
--- a/integration-test-groups/http/netty-http/pom.xml
+++ b/integration-test-groups/http/netty-http/pom.xml
@@ -77,6 +77,11 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
<profile>
diff --git
a/integration-test-groups/http/netty-http/src/test/java/org/apache/camel/quarkus/component/http/netty/it/NettyHttpJaasTest.java
b/integration-test-groups/http/netty-http/src/test/java/org/apache/camel/quarkus/component/http/netty/it/NettyHttpJaasTest.java
index e973865eda..9da670f0d9 100644
---
a/integration-test-groups/http/netty-http/src/test/java/org/apache/camel/quarkus/component/http/netty/it/NettyHttpJaasTest.java
+++
b/integration-test-groups/http/netty-http/src/test/java/org/apache/camel/quarkus/component/http/netty/it/NettyHttpJaasTest.java
@@ -19,10 +19,17 @@ package org.apache.camel.quarkus.component.http.netty.it;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.component.http.common.HttpTestResource;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.eclipse.microprofile.config.ConfigProvider;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
+@TestCertificates(certificates = {
+ @Certificate(name = HttpTestResource.KEYSTORE_NAME, formats = {
+ Format.PKCS12 }, password =
HttpTestResource.KEYSTORE_PASSWORD) })
@QuarkusTest
@QuarkusTestResource(NettyHttpJaasTestResource.class)
public class NettyHttpJaasTest {
diff --git a/integration-test-groups/http/vertx-http/pom.xml
b/integration-test-groups/http/vertx-http/pom.xml
index ab645b167c..e68a75d038 100644
--- a/integration-test-groups/http/vertx-http/pom.xml
+++ b/integration-test-groups/http/vertx-http/pom.xml
@@ -69,6 +69,11 @@
<scope>test</scope>
<type>test-jar</type>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
<profile>
diff --git
a/integration-test-groups/http/vertx-http/src/test/java/org/apache/camel/quarkus/component/http/vertx/it/VertxHttpTest.java
b/integration-test-groups/http/vertx-http/src/test/java/org/apache/camel/quarkus/component/http/vertx/it/VertxHttpTest.java
index 18a6c43687..e840c7960f 100644
---
a/integration-test-groups/http/vertx-http/src/test/java/org/apache/camel/quarkus/component/http/vertx/it/VertxHttpTest.java
+++
b/integration-test-groups/http/vertx-http/src/test/java/org/apache/camel/quarkus/component/http/vertx/it/VertxHttpTest.java
@@ -19,13 +19,19 @@ package org.apache.camel.quarkus.component.http.vertx.it;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
import org.apache.camel.quarkus.component.http.common.AbstractHttpTest;
import org.apache.camel.quarkus.component.http.common.HttpTestResource;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+@TestCertificates(certificates = {
+ @Certificate(name = HttpTestResource.KEYSTORE_NAME, formats = {
+ Format.PKCS12 }, password =
HttpTestResource.KEYSTORE_PASSWORD) })
@QuarkusTest
@QuarkusTestResource(HttpTestResource.class)
public class VertxHttpTest extends AbstractHttpTest {
diff --git
a/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTestProfile.java
b/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/CertificatesUtil.java
similarity index 61%
copy from
integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTestProfile.java
copy to
integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/CertificatesUtil.java
index 7bba8b76b0..0c0bd03e9b 100644
---
a/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTestProfile.java
+++
b/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/CertificatesUtil.java
@@ -14,19 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.component.vertx.websocket.it;
+package org.apache.camel.quarkus.test.support.certificate;
-import java.util.Map;
+public class CertificatesUtil {
+ public static final String DEFAULT_CERTS_BASEDIR = "target/classes/certs";
-import io.quarkus.test.junit.QuarkusTestProfile;
-
-public class VertxWebsocketSslTestProfile implements QuarkusTestProfile {
+ private CertificatesUtil() {
+ }
- @Override
- public Map<String, String> getConfigOverrides() {
- return Map.of(
- "quarkus.http.ssl.certificate.files", "server-cert.pem",
- "quarkus.http.ssl.certificate.key-files", "server-key.pem",
- "quarkus.http.insecure-requests", "disabled");
+ public static String keystoreFile(String name, String extension) {
+ return DEFAULT_CERTS_BASEDIR + "/" + name + "-keystore." + extension;
}
}
diff --git
a/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/TestCertificateGenerationExtension.java
b/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/TestCertificateGenerationExtension.java
index c695fdcaab..d11ad362e3 100644
---
a/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/TestCertificateGenerationExtension.java
+++
b/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/TestCertificateGenerationExtension.java
@@ -43,7 +43,7 @@ import org.testcontainers.DockerClientFactory;
* based on docker host (required for usage with external docker host)
* Therefore I created a new annotation 'TestCertificates' which would use
this new extension.
*/
-public class TestCertificateGenerationExtension implements BeforeAllCallback,
ParameterResolver {
+public class TestCertificateGenerationExtension implements BeforeAllCallback {
private static final Logger LOGGER =
Logger.getLogger(TestCertificateGenerationExtension.class);
public static TestCertificateGenerationExtension
getInstance(ExtensionContext extensionContext) {
@@ -65,8 +65,12 @@ public class TestCertificateGenerationExtension implements
BeforeAllCallback, Pa
var annotation = maybe.get();
//cn and alternativeSubjectName might be different (to reflect docker
host)
- Optional<String> cn = resolveDockerHost();
- Optional<String> altSubName = cn.stream().map(h ->
"IP:%s".formatted(h)).findAny();
+ Optional<String> cn = Optional.empty();
+ Optional<String> altSubName = Optional.empty();
+ if (annotation.docker()) {
+ cn = resolveDockerHost();
+ altSubName = cn.stream().map(h -> "IP:%s".formatted(h)).findAny();
+ }
for (Certificate certificate : annotation.certificates()) {
String baseDir = annotation.baseDir();
@@ -113,15 +117,4 @@ public class TestCertificateGenerationExtension implements
BeforeAllCallback, Pa
return Optional.empty();
}
- @Override
- public boolean supportsParameter(ParameterContext parameterContext,
ExtensionContext extensionContext)
- throws ParameterResolutionException {
- throw new IllegalArgumentException("Not supported!");
- }
-
- @Override
- public Object resolveParameter(ParameterContext parameterContext,
ExtensionContext extensionContext)
- throws ParameterResolutionException {
- throw new IllegalArgumentException("Not supported!");
- }
}
diff --git
a/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/TestCertificates.java
b/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/TestCertificates.java
index 0d686dbc58..4c9a9ee4f8 100644
---
a/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/TestCertificates.java
+++
b/integration-tests-support/certificate-generator/src/main/java/org/apache/camel/quarkus/test/support/certificate/TestCertificates.java
@@ -39,8 +39,9 @@ public @interface TestCertificates {
/**
* The base directory in which certificates will be generated.
+ * Default value is `target/classes/certs`
*/
- String baseDir();
+ String baseDir() default CertificatesUtil.DEFAULT_CERTS_BASEDIR;
/**
* The certificates to generate.
@@ -52,4 +53,10 @@ public @interface TestCertificates {
* Whether to replace the certificates if they already exist.
*/
boolean replaceIfExists() default false;
+
+ /**
+ * Whether certificate is used in docker container. If so, the cn and
subject alt name has to equal docker host
+ * (which might differ in case of external docker host)
+ */
+ boolean docker() default false;
}
diff --git a/integration-tests/ftp/pom.xml b/integration-tests/ftp/pom.xml
index e6931201bb..10f71511bb 100644
--- a/integration-tests/ftp/pom.xml
+++ b/integration-tests/ftp/pom.xml
@@ -85,6 +85,11 @@
<artifactId>sshd-scp</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
diff --git
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftp/it/FtpTestResource.java
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftp/it/FtpTestResource.java
index e2713b8a1a..f97fa3d65a 100644
---
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftp/it/FtpTestResource.java
+++
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftp/it/FtpTestResource.java
@@ -90,15 +90,18 @@ public class FtpTestResource implements
QuarkusTestResourceLifecycleManager {
ListenerFactory factory = createListenerFactory(port);
- FtpServerFactory serverFactory = new FtpServerFactory();
- serverFactory.setUserManager(userMgr);
- serverFactory.setFileSystem(fsf);
- serverFactory.setConnectionConfig(new
ConnectionConfigFactory().createConnectionConfig());
- serverFactory.addListener("default", factory.createListener());
-
- FtpServerFactory ftpServerFactory = serverFactory;
- ftpServer = ftpServerFactory.createServer();
- ftpServer.start();
+ if (factory != null) {
+ FtpServerFactory serverFactory = new FtpServerFactory();
+ serverFactory.setUserManager(userMgr);
+ serverFactory.setFileSystem(fsf);
+ serverFactory.setConnectionConfig(new
ConnectionConfigFactory().createConnectionConfig());
+
+ serverFactory.addListener("default", factory.createListener());
+
+ FtpServerFactory ftpServerFactory = serverFactory;
+ ftpServer = ftpServerFactory.createServer();
+ ftpServer.start();
+ }
return CollectionHelper.mapOf(
"camel." + componentName + ".test-port",
Integer.toString(port),
diff --git
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTest.java
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTest.java
index 4157893a57..753990d8fb 100644
---
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTest.java
+++
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTest.java
@@ -20,15 +20,24 @@ import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.CertificatesUtil;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.hamcrest.CoreMatchers.is;
+@TestCertificates(certificates = {
+ @Certificate(name = "ftp", formats = {
+ Format.PKCS12 }, password = "password") })
@Disabled //https://github.com/apache/camel-quarkus/issues/4089
@QuarkusTest
@QuarkusTestResource(FtpsTestResource.class)
class FtpsTest {
+ static final String CERTIFICATE_KEYSTORE_FILE =
CertificatesUtil.keystoreFile("ftp", "p12");
+
@Test
public void testFtpsComponent() {
// Create a new file on the FTPS server
diff --git
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTestResource.java
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTestResource.java
index 8859cc572b..9181cb736d 100644
---
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTestResource.java
+++
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/ftps/it/FtpsTestResource.java
@@ -16,12 +16,7 @@
*/
package org.apache.camel.quarkus.component.ftps.it;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.Map;
-import java.util.Objects;
import org.apache.camel.quarkus.component.ftp.it.FtpTestResource;
import org.apache.ftpserver.listener.ListenerFactory;
@@ -29,45 +24,27 @@ import org.apache.ftpserver.ssl.SslConfigurationFactory;
public class FtpsTestResource extends FtpTestResource {
- private Path keystoreFilePath;
-
public FtpsTestResource() {
super("ftps");
}
@Override
- public Map<String, String> start() {
- try (InputStream stream =
Thread.currentThread().getContextClassLoader().getResourceAsStream("keystore.p12"))
{
- Objects.requireNonNull(stream, "FTP keystore file keystore.p12
could not be loaded");
- keystoreFilePath = Files.createTempFile("camel-ftps-keystore",
"p12");
- Files.write(keystoreFilePath, stream.readAllBytes());
- } catch (IOException e) {
- throw new RuntimeException(e);
+ protected ListenerFactory createListenerFactory(int port) {
+ //do not create a factory if keystore file does not exists
+ //because the test is disabled, but the test resource is "activated",
this condition prevents the failure
+ //for the FtpTest
+ if (!Path.of(FtpsTest.CERTIFICATE_KEYSTORE_FILE).toFile().exists()) {
+ return null;
}
- return super.start();
- }
- @Override
- protected ListenerFactory createListenerFactory(int port) {
SslConfigurationFactory sslConfigFactory = new
SslConfigurationFactory();
- sslConfigFactory.setKeystoreFile(keystoreFilePath.toFile());
+
sslConfigFactory.setKeystoreFile(Path.of(FtpsTest.CERTIFICATE_KEYSTORE_FILE).toFile());
sslConfigFactory.setKeystoreType("PKCS12");
sslConfigFactory.setKeystorePassword("password");
- sslConfigFactory.setKeyPassword("password");
sslConfigFactory.setSslProtocol("TLSv1.3");
ListenerFactory factory = super.createListenerFactory(port);
factory.setSslConfiguration(sslConfigFactory.createSslConfiguration());
return factory;
}
-
- @Override
- public void stop() {
- super.stop();
- try {
- Files.deleteIfExists(keystoreFilePath);
- } catch (IOException e) {
- // Ignored
- }
- }
}
diff --git
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTest.java
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTest.java
index d3a4af9d15..875b1325b4 100644
---
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTest.java
+++
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTest.java
@@ -20,10 +20,18 @@ import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import static org.hamcrest.CoreMatchers.is;
+@TestCertificates(certificates = {
+ @Certificate(name = "ftp", formats = {
+ Format.PEM }, password = "password"),
+ @Certificate(name = "ftp", formats = {
+ Format.PKCS12 }, password = "password") })
@QuarkusTest
@QuarkusTestResource(SftpTestResource.class)
class SftpTest {
diff --git
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTestResource.java
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTestResource.java
index 7d6d0efb80..67035d47b8 100644
---
a/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTestResource.java
+++
b/integration-tests/ftp/src/test/java/org/apache/camel/quarkus/component/sftp/it/SftpTestResource.java
@@ -64,7 +64,7 @@ public class SftpTestResource implements
QuarkusTestResourceLifecycleManager {
sshServer = SshServer.setUpDefaultServer();
sshServer.setPort(port);
- sshServer.setKeyPairProvider(new
ClassLoadableResourceKeyPairProvider("test.key"));
+ sshServer.setKeyPairProvider(new
ClassLoadableResourceKeyPairProvider("certs/ftp.key"));
sshServer.setSubsystemFactories(Collections.singletonList(new
SftpSubsystemFactory()));
sshServer.setCommandFactory(new ScpCommandFactory());
sshServer.setPasswordAuthenticator((username, password, session)
-> true);
diff --git a/integration-tests/ftp/src/test/resources/keystore.p12
b/integration-tests/ftp/src/test/resources/keystore.p12
deleted file mode 100644
index ae508effc1..0000000000
Binary files a/integration-tests/ftp/src/test/resources/keystore.p12 and
/dev/null differ
diff --git a/integration-tests/ftp/src/test/resources/readme.adoc
b/integration-tests/ftp/src/test/resources/readme.adoc
deleted file mode 100644
index 1167900dea..0000000000
--- a/integration-tests/ftp/src/test/resources/readme.adoc
+++ /dev/null
@@ -1,28 +0,0 @@
-=== How to generate test.key
-
-1. Generate private certificate for client.
-[source]
-openssl genrsa -out test.key 2048
-
-=== How to generate keystore.p12
-
-[start=2]
-. Generate certificate signing request
-[source]
-openssl req -new -subj '/C=CA/L=camel-ftp/O=camel-ftp/CN=localhost' -key
test.key -out test.csr
-. Generate a key for the cert. authority
-[source]
-openssl genrsa -out ca.key 2048
-. Generate a self-signed certificate for cert. authority
-[source]
-openssl req -new -subj '/C=CA/L=camel-ftp/O=camel-ftp/CN=localhost' -x509 -key
ca.key -out ca.crt
-. Very easy way to sign a certificate
-[source]
-openssl x509 -req -in test.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out
test.crt -days 10000
-. Create a kyestore
-[source]
-openssl pkcs12 -export -in test.crt -inkey test.key -certfile ca.crt -name
"serverftp" -out keystore.p12 -passout pass:password -keypbe aes-256-cbc
-certpbe aes-256-cbc
-
-
-
-
diff --git a/integration-tests/ftp/src/test/resources/test.key
b/integration-tests/ftp/src/test/resources/test.key
deleted file mode 100644
index 971dd4c518..0000000000
--- a/integration-tests/ftp/src/test/resources/test.key
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCUuR9+HMWaD0tz
-N+pF7MfRHdTtt1uCYgfBrghWOFKO82ZCSUWR5uR/eq15pdtNZvqAS0Ck6K7NKtlQ
-Hcls5/wMiI4oLyn3RfKNTSnBkK4lNELqrTMGgBC6LxcqThGNOc1oQD0dZLpbWmZU
-LuddrBRaPuTOa1d9x/mi/rN5VLL/QOHx8Ej4teR74APn0JmTGwwV5EFDXWU6qSvp
-ASR65wrrTcMxie0LFwe3PWOG16T0w58eymjGlr9t9xPO9l6FGe5IfmdW2GWIgeWr
-y0mlp0QABjtIonn6UpbyUkUrpYZeiU9M7e0QHQa25mKTJpCtat3/UvY1Qf8Q7A1j
-lt2duTgBAgMBAAECggEAAXnm7J8HfRR6yL18103W2+YCZ4ui3mPvtMXv8j8j3qRe
-1viYNq8GhJdoomT5jMahZOWaUii3F3U96/QnvCt/TnaKhq6VKY2prypdaDzx5Y+j
-vGWUtJNP1zFBdxuIRBEXT1oX4TNPQDng+yPuCvl6yDyIk93v4+E4wpvplyI2lp7/
-3j7AwopNJmJ04YN7mF1APjjDf1nlF2c/M7tLGOmDSzW4oj0nz1NqKl/Lv+lQBbcy
-9W6H0l3WEMNUFidQ/Sur9NOkC9t1ogcAiaiTVAH4Z6QGSzXSUr4owfhLnt/aEwIp
-XyQzKD4ztZv5dmDiQj0y0ICD5Kzw4r+0wtRId/gAOQKBgQDNOHQQRl+Js/IuNz5k
-wvH/h/68uhnWi/vuBk9PFv8waQogCQfEhLB3GnDk6recRpLYgxvyn+CdUeuVkMXn
-H1Is1s5Brd24OFqA0yUJALgGIKJDeeAOCRLv6teL0pmAhNjTD9ITVdLrO+05PdeG
-Y/n0ztITylH81MVjsh0hEOUDVQKBgQC5heIlsO+Qn4yGZwg5/UgYw88yPYyVDvYz
-2884SRnzBIVrry7nmQFteTLEYdswnS5Yj67BW8cVFWV6Hidb2svWf9FBNXjPwNnX
-G4Ha4Ww55Lsp5Fvj8qIJwf+CYbc8BH4osDEuXK56yspNNB1mU+MEdjpI3FfhTKTK
-JY2wpQs5/QKBgQC4G9xsOWY+mLQ9aAxOw2Ht2Gjdkavaga1bhkeiccQw/xs5UECq
-ukvCHnOHu1dMGThmi4EIMwyEtti+TqptRfkoBvH1lHDkc5ImHscMA5wUyzQnivBK
-RzO5D5ueciqKVSRcfcX+2LEnnpSdFPEFPS4ixWVMoebaB1yqq0Fcx9ZdHQKBgBRn
-jT/n/fFCGwqNOnJmUQ+oOZmk+1lJk/qQKnJeV+RKkwIM+nOueGG5+sNun9Tw9K/4
-3ZeWqIbBG7AasOmBXvnwhOtPHkJ7S3pFJDsWn/ieF5e77f9cKEY6eAe3B5gqRlXj
-SwV2XBpVQ3rKSJGAmG9dMXviAChfbaBuEO9kt59hAoGBALdC531VRHjRyozHNgkJ
-Auyfv5LhR/0YfPrPZl0MoGkq/T3aOwvLtwXhtYyJBgzGox4KH8dsFLHUwD58uSvs
-cIIBhhkbdwD6Myu+k1OsC83qLDfo/mjSBAqOKVdQr7zEFndzPahJzv1MI91WAXvu
-krY/Q764PuO8mCHRjSLSllz7
------END PRIVATE KEY-----
diff --git a/integration-tests/http-grouped/pom.xml
b/integration-tests/http-grouped/pom.xml
index aecfcfa540..f368798e51 100644
--- a/integration-tests/http-grouped/pom.xml
+++ b/integration-tests/http-grouped/pom.xml
@@ -116,6 +116,11 @@
<artifactId>camel-quarkus-integration-test-support</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git
a/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTest.java
b/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTest.java
index 9c1fb307a0..bf65fb9092 100644
---
a/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTest.java
+++
b/integration-tests/kafka-sasl-ssl/src/test/java/org/apache/camel/quarkus/kafka/sasl/KafkaSaslSslTest.java
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@TestCertificates(certificates = {
@Certificate(name = KafkaSaslSslTestResource.KAFKA_HOSTNAME, formats =
{
Format.PKCS12 }, password =
KafkaSaslSslTestResource.KAFKA_KEYSTORE_PASSWORD)
-}, baseDir = KafkaSaslSslTestResource.CERTS_BASEDIR)
+}, baseDir = KafkaSaslSslTestResource.CERTS_BASEDIR, docker = true)
@QuarkusTest
@QuarkusTestResource(KafkaSaslSslTestResource.class)
public class KafkaSaslSslTest {
diff --git
a/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTest.java
b/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTest.java
index 0921d58d97..f97fae8f29 100644
---
a/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTest.java
+++
b/integration-tests/kafka-ssl/src/test/java/org/apache/camel/quarkus/kafka/ssl/KafkaSslTest.java
@@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.is;
@TestCertificates(certificates = {
@Certificate(name = KafkaSslTestResource.KAFKA_HOSTNAME, formats = {
Format.PKCS12 }, password =
KafkaSslTestResource.KAFKA_KEYSTORE_PASSWORD)
-}, baseDir = KafkaSslTestResource.CERTS_BASEDIR)
+}, baseDir = KafkaSslTestResource.CERTS_BASEDIR, docker = true)
@QuarkusTest
@QuarkusTestResource(KafkaSslTestResource.class)
public class KafkaSslTest {
diff --git a/integration-tests/lumberjack/pom.xml
b/integration-tests/lumberjack/pom.xml
index 65e6b7f6a2..7dcccc92ae 100644
--- a/integration-tests/lumberjack/pom.xml
+++ b/integration-tests/lumberjack/pom.xml
@@ -69,6 +69,11 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
diff --git
a/integration-tests/lumberjack/src/main/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackRoutes.java
b/integration-tests/lumberjack/src/main/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackRoutes.java
index 0e90986455..c75271ac24 100644
---
a/integration-tests/lumberjack/src/main/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackRoutes.java
+++
b/integration-tests/lumberjack/src/main/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackRoutes.java
@@ -83,7 +83,7 @@ public class LumberjackRoutes extends RouteBuilder {
KeyManagersParameters keyManagersParameters = new
KeyManagersParameters();
KeyStoreParameters keyStore = new KeyStoreParameters();
keyStore.setPassword("changeit");
- keyStore.setResource("ssl/keystore.jks");
+ keyStore.setResource("certs/lumberjack-keystore.jks");
keyManagersParameters.setKeyPassword("changeit");
keyManagersParameters.setKeyStore(keyStore);
sslContextParameters.setKeyManagers(keyManagersParameters);
diff --git
a/integration-tests/lumberjack/src/main/resources/application.properties
b/integration-tests/lumberjack/src/main/resources/application.properties
index f870ae692a..9e8f5a9263 100644
--- a/integration-tests/lumberjack/src/main/resources/application.properties
+++ b/integration-tests/lumberjack/src/main/resources/application.properties
@@ -15,4 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-quarkus.native.resources.includes = io/*,ssl/*
+quarkus.native.resources.includes = io/*,certs/*
diff --git a/integration-tests/lumberjack/src/main/resources/ssl/keystore.jks
b/integration-tests/lumberjack/src/main/resources/ssl/keystore.jks
deleted file mode 100644
index 78e8571fd3..0000000000
Binary files a/integration-tests/lumberjack/src/main/resources/ssl/keystore.jks
and /dev/null differ
diff --git
a/integration-tests/lumberjack/src/test/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackClientUtil.java
b/integration-tests/lumberjack/src/test/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackClientUtil.java
index 21c79c415d..c93f48cad4 100644
---
a/integration-tests/lumberjack/src/test/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackClientUtil.java
+++
b/integration-tests/lumberjack/src/test/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackClientUtil.java
@@ -145,7 +145,7 @@ public class LumberjackClientUtil {
TrustManagersParameters trustManagersParameters = new
TrustManagersParameters();
KeyStoreParameters trustStore = new CustomKeyStoreParameters();
trustStore.setPassword("changeit");
- trustStore.setResource("ssl/keystore.jks");
+ trustStore.setResource("certs/lumberjack-keystore.jks");
trustManagersParameters.setKeyStore(trustStore);
sslContextParameters.setTrustManagers(trustManagersParameters);
diff --git
a/integration-tests/lumberjack/src/test/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackTest.java
b/integration-tests/lumberjack/src/test/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackTest.java
index a27c298ce3..54f8985ec8 100644
---
a/integration-tests/lumberjack/src/test/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackTest.java
+++
b/integration-tests/lumberjack/src/test/java/org/apache/camel/quarkus/component/lumberjack/it/LumberjackTest.java
@@ -22,6 +22,9 @@ import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.common.http.TestHTTPEndpoint;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.eclipse.microprofile.config.ConfigProvider;
import org.junit.jupiter.api.Test;
@@ -29,6 +32,9 @@ import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.junit.jupiter.api.Assertions.assertEquals;
+@TestCertificates(certificates = {
+ @Certificate(name = "lumberjack", formats = {
+ Format.JKS }, password = "changeit") })
@QuarkusTest
@TestHTTPEndpoint(LumberjackResource.class)
@QuarkusTestResource(LumberjackTestResource.class)
diff --git a/integration-tests/mail/README.adoc
b/integration-tests/mail/README.adoc
deleted file mode 100644
index e82fb8e99f..0000000000
--- a/integration-tests/mail/README.adoc
+++ /dev/null
@@ -1,17 +0,0 @@
-== Camel Quarkus Mail integration tests
-
-To regenerate the SSL certificates and trust stores for use with local host
testing run the following script:
-
-[source,shell]
-----
-cd src/test/resources
-./regenerate-certificates.sh
-----
-
-If required, you can override the default certificate CN and SAN configuration
by passing them as script arguments:
-
-[source,shell]
-----
-cd src/test/resources
-./regenerate-certificates.sh "other-dns-or-ip"
"DNS:another-dns,IP:192.168.1.150"
-----
diff --git a/integration-tests/mail/pom.xml b/integration-tests/mail/pom.xml
index f9a0f5e2b1..452d59e356 100644
--- a/integration-tests/mail/pom.xml
+++ b/integration-tests/mail/pom.xml
@@ -85,6 +85,11 @@
<artifactId>quarkus-junit4-mock</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git
a/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTest.java
b/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTest.java
index 4ca05a9f7b..3f6665b64b 100644
---
a/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTest.java
+++
b/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTest.java
@@ -35,8 +35,12 @@ import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import jakarta.json.bind.JsonbBuilder;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
import org.apache.camel.ExchangePropertyKey;
import org.apache.camel.ServiceStatus;
+import org.apache.camel.quarkus.test.support.certificate.CertificatesUtil;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.eclipse.angus.mail.util.MailConnectException;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigProvider;
@@ -53,9 +57,14 @@ import static
org.apache.camel.quarkus.component.mail.CamelRoute.PASSWORD;
import static org.apache.camel.quarkus.component.mail.CamelRoute.USERNAME;
import static org.hamcrest.Matchers.is;
+@TestCertificates(certificates = {
+ @Certificate(name = "greenmail", formats = {
+ Format.PKCS12 }, password = MailTestResource.KEYSTORE_PASSWORD)
+}, docker = true)
@QuarkusTest
@QuarkusTestResource(MailTestResource.class)
public class MailTest {
+ static final String GREENMAIL_CERTIFICATE_STORE_FILE =
CertificatesUtil.keystoreFile("greenmail", "p12");
private static final Pattern DELIMITER_PATTERN =
Pattern.compile("\r\n[^\r\n]+");
private static final String EXPECTED_TEMPLATE = "${delimiter}\r\n"
+ "Content-Type: text/plain; charset=UTF8;
other-parameter=true\r\n"
diff --git
a/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTestResource.java
b/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTestResource.java
index a121a51cbb..d65a80f999 100644
---
a/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTestResource.java
+++
b/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTestResource.java
@@ -17,51 +17,32 @@
package org.apache.camel.quarkus.component.mail;
import java.io.IOException;
-import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
-import org.apache.commons.io.FileUtils;
import org.eclipse.microprofile.config.ConfigProvider;
import org.jboss.logging.Logger;
-import org.testcontainers.DockerClientFactory;
-import org.testcontainers.containers.Container.ExecResult;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
-import org.testcontainers.images.builder.Transferable;
import org.testcontainers.utility.MountableFile;
public class MailTestResource implements QuarkusTestResourceLifecycleManager {
private static final Logger LOG = Logger.getLogger(MailTestResource.class);
private static final String GREENMAIL_IMAGE_NAME =
ConfigProvider.getConfig().getValue("greenmail.container.image",
String.class);
- private static final String GREENMAIL_CERTIFICATE_STORE_FILE =
"greenmail.p12";
- private static final String GENERATE_CERTIFICATE_SCRIPT =
"generate-certificates.sh";
+ //default value used in testcontainer
+ static final String KEYSTORE_PASSWORD = "changeit";
+
private GenericContainer<?> container;
- private Path certificateStoreLocation;
@Override
public Map<String, String> start() {
- try {
- certificateStoreLocation =
Files.createTempDirectory("MailTestResource-");
- ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
- try (InputStream in =
classLoader.getResourceAsStream(GREENMAIL_CERTIFICATE_STORE_FILE)) {
- Files.copy(in,
certificateStoreLocation.resolve(GREENMAIL_CERTIFICATE_STORE_FILE));
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-
- String dockerHost =
DockerClientFactory.instance().dockerHostIpAddress();
- if (!dockerHost.equals("localhost") &&
!dockerHost.equals("127.0.0.1")) {
- regenerateCertificatesForDockerHost();
- }
-
container = new GenericContainer<>(GREENMAIL_IMAGE_NAME)
-
.withCopyToContainer(Transferable.of(getCertificateStoreContent()),
"/home/greenmail/greenmail.p12")
+
.withCopyToContainer(MountableFile.forClasspathResource("certs/greenmail-keystore.p12"),
+ "/home/greenmail/greenmail.p12")
.withExposedPorts(MailProtocol.allPorts())
.waitingFor(new HttpWaitStrategy()
.forPort(MailProtocol.API.getPort())
@@ -87,49 +68,11 @@ public class MailTestResource implements
QuarkusTestResourceLifecycleManager {
if (container != null) {
container.stop();
}
- if (certificateStoreLocation != null) {
- try {
- FileUtils.deleteDirectory(certificateStoreLocation.toFile());
- } catch (IOException e) {
- // Ignored
- }
- }
- }
-
- private void regenerateCertificatesForDockerHost() {
- // Run certificate generation in a container in case the target
platform does not have prerequisites like OpenSSL installed (E.g on Windows)
- String imageName =
ConfigProvider.getConfig().getValue("eclipse-temurin.container.image",
String.class);
- try (GenericContainer<?> container = new
GenericContainer<>(imageName)) {
- container.withCreateContainerCmdModifier(modifier -> {
- modifier.withEntrypoint("/bin/bash");
- modifier.withStdinOpen(true);
- modifier.withAttachStdout(true);
- });
- container.setWorkingDirectory("/");
- container.start();
-
- String host = container.getHost();
- container.copyFileToContainer(
-
MountableFile.forClasspathResource(GENERATE_CERTIFICATE_SCRIPT),
- "/" + GENERATE_CERTIFICATE_SCRIPT);
- ExecResult result = container.execInContainer("/bin/bash", "/" +
GENERATE_CERTIFICATE_SCRIPT, host,
- "DNS:%s,IP:%s".formatted(host, host), "/" +
GREENMAIL_CERTIFICATE_STORE_FILE);
-
- LOG.info(GENERATE_CERTIFICATE_SCRIPT + " - STDOUT:");
- LOG.info(result.getStdout());
- LOG.info(GENERATE_CERTIFICATE_SCRIPT + " - STDERR:");
- LOG.info(result.getStderr());
-
- container.copyFileFromContainer("/" +
GREENMAIL_CERTIFICATE_STORE_FILE,
-
certificateStoreLocation.resolve(GREENMAIL_CERTIFICATE_STORE_FILE).toString());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
}
private byte[] getCertificateStoreContent() {
try {
- return
Files.readAllBytes(certificateStoreLocation.resolve(GREENMAIL_CERTIFICATE_STORE_FILE));
+ return
Files.readAllBytes(Path.of(MailTest.GREENMAIL_CERTIFICATE_STORE_FILE));
} catch (IOException e) {
throw new RuntimeException(e);
}
diff --git a/integration-tests/mail/src/test/resources/generate-certificates.sh
b/integration-tests/mail/src/test/resources/generate-certificates.sh
deleted file mode 100755
index d36cf81c9a..0000000000
--- a/integration-tests/mail/src/test/resources/generate-certificates.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-
-export CN=${1:-localhost}
-export SUBJECT_ALT_NAMES=${2:-"DNS:localhost,IP:127.0.0.1"}
-export CERT_OUTPUT_FILE=${3:-greenmail.p12}
-
-echo "====> PWD = ${PWD}"
-echo "====> CN = ${CN}"
-echo "====> SUBJECT_ALT_NAMES = ${SUBJECT_ALT_NAMES}"
-echo "====> CERT_OUTPUT_FILE = ${CERT_OUTPUT_FILE}"
-
-openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout
greenmail.key -out greenmail.crt -subj "/CN=${CN}" -addext
"subjectAltName=${SUBJECT_ALT_NAMES}"
-openssl pkcs12 -export -out ${CERT_OUTPUT_FILE} -inkey greenmail.key -in
greenmail.crt -password pass:changeit
-
-rm -f *.crt *.key
diff --git a/integration-tests/mail/src/test/resources/greenmail.p12
b/integration-tests/mail/src/test/resources/greenmail.p12
deleted file mode 100644
index de455f1a73..0000000000
Binary files a/integration-tests/mail/src/test/resources/greenmail.p12 and
/dev/null differ
diff --git a/integration-tests/nats/pom.xml b/integration-tests/nats/pom.xml
index f54e12d231..40138dfff6 100644
--- a/integration-tests/nats/pom.xml
+++ b/integration-tests/nats/pom.xml
@@ -80,6 +80,11 @@
<artifactId>quarkus-junit4-mock</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
diff --git
a/integration-tests/nats/src/main/java/org/apache/camel/quarkus/component/nats/it/NatsRoutes.java
b/integration-tests/nats/src/main/java/org/apache/camel/quarkus/component/nats/it/NatsRoutes.java
index a8c5faba2e..4e4a0fd120 100644
---
a/integration-tests/nats/src/main/java/org/apache/camel/quarkus/component/nats/it/NatsRoutes.java
+++
b/integration-tests/nats/src/main/java/org/apache/camel/quarkus/component/nats/it/NatsRoutes.java
@@ -72,7 +72,7 @@ public class NatsRoutes extends RouteBuilder {
KeyManagersParameters keyManagersParameters = new
KeyManagersParameters();
KeyStoreParameters keyStore = new KeyStoreParameters();
keyStore.setPassword("password");
- keyStore.setResource("certs/keystore.jks");
+ keyStore.setResource("certs/nats-keystore.p12");
keyManagersParameters.setKeyPassword("password");
keyManagersParameters.setKeyStore(keyStore);
sslContextParameters.setKeyManagers(keyManagersParameters);
@@ -80,7 +80,7 @@ public class NatsRoutes extends RouteBuilder {
TrustManagersParameters trustManagersParameters = new
TrustManagersParameters();
KeyStoreParameters trustStore = new KeyStoreParameters();
trustStore.setPassword("password");
- trustStore.setResource("certs/truststore.jks");
+ trustStore.setResource("certs/nats-truststore.p12");
trustManagersParameters.setKeyStore(trustStore);
sslContextParameters.setTrustManagers(trustManagersParameters);
diff --git a/integration-tests/nats/src/main/resources/application.properties
b/integration-tests/nats/src/main/resources/application.properties
index 12875be04e..d52693413a 100644
--- a/integration-tests/nats/src/main/resources/application.properties
+++ b/integration-tests/nats/src/main/resources/application.properties
@@ -14,6 +14,6 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
-quarkus.native.resources.includes=certs/*.jks
+quarkus.native.resources.includes=certs/*.p12
camel.nats.test.enable-tls=${ENABLE_TLS_TESTS:false}
\ No newline at end of file
diff --git a/integration-tests/nats/src/main/resources/certs/keystore.jks
b/integration-tests/nats/src/main/resources/certs/keystore.jks
deleted file mode 100644
index daaea366bb..0000000000
Binary files a/integration-tests/nats/src/main/resources/certs/keystore.jks and
/dev/null differ
diff --git a/integration-tests/nats/src/main/resources/certs/truststore.jks
b/integration-tests/nats/src/main/resources/certs/truststore.jks
deleted file mode 100644
index 1d844c5699..0000000000
Binary files a/integration-tests/nats/src/main/resources/certs/truststore.jks
and /dev/null differ
diff --git
a/integration-tests/nats/src/test/java/org/apache/camel/quarkus/component/nats/it/NatsTest.java
b/integration-tests/nats/src/test/java/org/apache/camel/quarkus/component/nats/it/NatsTest.java
index e69466173d..71e5359170 100644
---
a/integration-tests/nats/src/test/java/org/apache/camel/quarkus/component/nats/it/NatsTest.java
+++
b/integration-tests/nats/src/test/java/org/apache/camel/quarkus/component/nats/it/NatsTest.java
@@ -21,6 +21,9 @@ import java.util.concurrent.TimeUnit;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.http.Header;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
@@ -28,6 +31,9 @@ import static io.restassured.RestAssured.given;
import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertEquals;
+@TestCertificates(certificates = {
+ @Certificate(name = "nats", formats = {
+ Format.PKCS12, Format.PEM }, password = "password") })
@QuarkusTestResource(NatsTestResource.class)
@QuarkusTest
class NatsTest {
diff --git
a/integration-tests/nats/src/test/java/org/apache/camel/quarkus/component/nats/it/NatsTestResource.java
b/integration-tests/nats/src/test/java/org/apache/camel/quarkus/component/nats/it/NatsTestResource.java
index a0c0c7cffb..179dfccc31 100644
---
a/integration-tests/nats/src/test/java/org/apache/camel/quarkus/component/nats/it/NatsTestResource.java
+++
b/integration-tests/nats/src/test/java/org/apache/camel/quarkus/component/nats/it/NatsTestResource.java
@@ -134,18 +134,19 @@ public class NatsTestResource implements
QuarkusTestResourceLifecycleManager {
GenericContainer<?> container = new GenericContainer<>(NATS_IMAGE)
.withExposedPorts(NATS_SERVER_PORT)
.withNetworkAliases("tlsAuthContainer")
- .withClasspathResourceMapping("certs/ca.pem", "/certs/ca.pem",
BindMode.READ_ONLY, SelinuxContext.SHARED)
- .withClasspathResourceMapping("certs/key.pem",
"/certs/key.pem", BindMode.READ_ONLY, SelinuxContext.SHARED)
- .withClasspathResourceMapping("certs/server.pem",
"/certs/server.pem", BindMode.READ_ONLY,
+ .withClasspathResourceMapping("certs/nats-ca.crt",
"/certs/nats-ca.crt", BindMode.READ_ONLY,
+ SelinuxContext.SHARED)
+ .withClasspathResourceMapping("certs/nats.key",
"/certs/nats.key", BindMode.READ_ONLY, SelinuxContext.SHARED)
+ .withClasspathResourceMapping("certs/nats.crt",
"/certs/nats.crt", BindMode.READ_ONLY,
SelinuxContext.SHARED)
.withClasspathResourceMapping("conf/tls.conf",
"/conf/tls.conf", BindMode.READ_ONLY, SelinuxContext.SHARED)
.withCommand(
"--config", "/conf/tls.conf",
"--tls",
- "--tlscert=/certs/server.pem",
- "--tlskey=/certs/key.pem",
+ "--tlscert=/certs/nats.crt",
+ "--tlskey=/certs/nats.key",
"--tlsverify",
- "--tlscacert=/certs/ca.pem")
+ "--tlscacert=/certs/nats-ca.crt")
.withLogConsumer(new
Slf4jLogConsumer(LOG).withPrefix("tlsAuthContainer"))
.waitingFor(Wait.forLogMessage(".*Server is ready.*", 1));
try {
diff --git a/integration-tests/nats/src/test/resources/certs/ca.pem
b/integration-tests/nats/src/test/resources/certs/ca.pem
deleted file mode 100644
index d13e913639..0000000000
--- a/integration-tests/nats/src/test/resources/certs/ca.pem
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDXDCCAkQCCQDI2Vsry8+BDDANBgkqhkiG9w0BAQsFADBwMQswCQYDVQQGEwJV
-UzELMAkGA1UECAwCQ0ExEDAOBgNVBAoMB1N5bmFkaWExEDAOBgNVBAsMB25hdHMu
-aW8xEjAQBgNVBAMMCWxvY2FsaG9zdDEcMBoGCSqGSIb3DQEJARYNZGVyZWtAbmF0
-cy5pbzAeFw0xOTEwMTcxMzAzNThaFw0yOTEwMTQxMzAzNThaMHAxCzAJBgNVBAYT
-AlVTMQswCQYDVQQIDAJDQTEQMA4GA1UECgwHU3luYWRpYTEQMA4GA1UECwwHbmF0
-cy5pbzESMBAGA1UEAwwJbG9jYWxob3N0MRwwGgYJKoZIhvcNAQkBFg1kZXJla0Bu
-YXRzLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAohX2dXdHIDM5
-yZDWk96b0mwRTHhBIOKtMPTTs/zKmlAgjjDxW7kSg0JimTNds9YbJ33FhcEJKXtV
-KH3Cn0uyZPS1VcTzPr7XP2QI+9SqqLuahkHAhgqoRwK62fTFJgzdZO0f9w9WwzMi
-gGk/v7KkKFa/9xKLCa9DTEJ9FA34HuYoBxXMZvypDm8d+0kxOCdThpzhKeucE4ya
-jFlvOP9/l7GyjlczzAD/nt/QhPfSeIx1MF0ICj5qzwPD/jB1ekoL9OShoHvoEyXo
-UO13GMdVmZqwJcS7Vk5XNEZoH0cxSw/SrZGCE9SFjR1t8TAe3QZiZ9E8EAg4IzJQ
-jfR2II5LiQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBIwib+0xLth/1+URtgQFn8
-dvQNqnJjlqC27U48qiTCTC5vJWbQDqUg9o6gtwZyYEHQ7dMmn68ozDzcGTCxaikV
-n01Bj2ijODK96Jrm/P5aVkP5Cn06FfudluZI2Q/A1cqTsa8V4rj02PpwCcLEaDqX
-yhztlhbKypWrlGuWpVlDBWstyRar98vvRK1XEyBu2NHp2fy49cwJCub4Cmz920fh
-oiIwzXIKtfnf1GEjUnsuFPMgCxvhjirYNPWWjqaBldrM/dBJqwTyZf/p6g40vufN
-JJDc65c4tyRwBSBdFn+Q4zD44M0AR/8THAeIfsT42lyl8fMV5A4fe1nAVJDC4Z/H
------END CERTIFICATE-----
diff --git a/integration-tests/nats/src/test/resources/certs/key.pem
b/integration-tests/nats/src/test/resources/certs/key.pem
deleted file mode 100644
index f2c2c6c2f5..0000000000
--- a/integration-tests/nats/src/test/resources/certs/key.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEuwIBADANBgkqhkiG9w0BAQEFAASCBKUwggShAgEAAoIBAQDm+0dlzcmiLa+L
-zdVqeVQ8B1/rWnErK+VvvjH7FmVodg5Z5+RXyojpd9ZBrVd6QrLSVMQPfFvBvGGX
-4yI6Ph5KXUefa31vNOOMhp2FGSmaEVhETKGQ0xRh4VfaAerOP5Cunl0TbSyJyjkV
-a7aeMtcqTEiFL7Ae2EtiMhTrMrYpBDQ8rzm2i1IyTb9DX5v7DUOmrSynQSlVyXCz
-tRVGNL/kHlItpEku1SHt/AD3ogu8EgqQZFB8xRRw9fubYgh4Q0kx80e4k9QtTKnc
-F3B2NGb/ZcE5Z+mmHIBq8J2zKMijOrdd3m5TbQmzDbETEOjs4L1eoZRLcL/cvYu5
-gmXdr4F7AgMBAAECggEBAK4sr3MiEbjcsHJAvXyzjwRRH1Bu+8VtLW7swe2vvrpd
-w4aiKXrV/BXpSsRtvPgxkXyvdMSkpuBZeFI7cVTwAJFc86RQPt77x9bwr5ltFwTZ
-rXCbRH3b3ZPNhByds3zhS+2Q92itu5cPyanQdn2mor9/lHPyOOGZgobCcynELL6R
-wRElkeDyf5ODuWEd7ADC5IFyZuwb3azNVexIK+0yqnMmv+QzEW3hsycFmFGAeB7v
-MIMjb2BhLrRr6Y5Nh+k58yM5DCf9h/OJhDpeXwLkxyK4BFg+aZffEbUX0wHDMR7f
-/nMv1g6cKvDWiLU8xLzez4t2qNIBNdxw5ZSLyQRRolECgYEA+ySTKrBAqI0Uwn8H
-sUFH95WhWUXryeRyGyQsnWAjZGF1+d67sSY2un2W6gfZrxRgiNLWEFq9AaUs0MuH
-6syF4Xwx/aZgU/gvsGtkgzuKw1bgvekT9pS/+opmHRCZyQAFEHj0IEpzyB6rW1u/
-LdlR3ShEENnmXilFv/uF/uXP5tMCgYEA63LiT0w46aGPA/E+aLRWU10c1eZ7KdhR
-c3En6zfgIxgFs8J38oLdkOR0CF6T53DSuvGR/OprVKdlnUhhDxBgT1oQjK2GlhPx
-JV5uMvarJDJxAwsF+7T4H2QtZ00BtEfpyp790+TlypSG1jo/BnSMmX2uEbV722lY
-hzINLY49obkCgYBEpN2YyG4T4+PtuXznxRkfogVk+kiVeVx68KtFJLbnw//UGT4i
-EHjbBmLOevDT+vTb0QzzkWmh3nzeYRM4aUiatjCPzP79VJPsW54whIDMHZ32KpPr
-TQMgPt3kSdpO5zN7KiRIAzGcXE2n/e7GYGUQ1uWr2XMu/4byD5SzdCscQwJ/Ymii
-LoKtRvk/zWYHr7uwWSeR5dVvpQ3E/XtONAImrIRd3cRqXfJUqTrTRKxDJXkCmyBc
-5FkWg0t0LUkTSDiQCJqcUDA3EINFR1kwthxja72pfpwc5Be/nV9BmuuUysVD8myB
-qw8A/KsXsHKn5QrRuVXOa5hvLEXbuqYw29mX6QKBgDGDzIzpR9uPtBCqzWJmc+IJ
-z4m/1NFlEz0N0QNwZ/TlhyT60ytJNcmW8qkgOSTHG7RDueEIzjQ8LKJYH7kXjfcF
-6AJczUG5PQo9cdJKo9JP3e1037P/58JpLcLe8xxQ4ce03zZpzhsxR2G/tz8DstJs
-b8jpnLyqfGrcV2feUtIZ
------END PRIVATE KEY-----
diff --git a/integration-tests/nats/src/test/resources/certs/server.pem
b/integration-tests/nats/src/test/resources/certs/server.pem
deleted file mode 100644
index e36fd9d62c..0000000000
--- a/integration-tests/nats/src/test/resources/certs/server.pem
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDPTCCAiWgAwIBAgIJAJCSLX9jr5W7MA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
-BAYTAlVTMQswCQYDVQQIDAJDQTEQMA4GA1UECgwHU3luYWRpYTEQMA4GA1UECwwH
-bmF0cy5pbzESMBAGA1UEAwwJbG9jYWxob3N0MRwwGgYJKoZIhvcNAQkBFg1kZXJl
-a0BuYXRzLmlvMB4XDTE5MTAxNzEzNTcyNloXDTI5MTAxNDEzNTcyNlowDTELMAkG
-A1UEBhMCVVMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDm+0dlzcmi
-La+LzdVqeVQ8B1/rWnErK+VvvjH7FmVodg5Z5+RXyojpd9ZBrVd6QrLSVMQPfFvB
-vGGX4yI6Ph5KXUefa31vNOOMhp2FGSmaEVhETKGQ0xRh4VfaAerOP5Cunl0TbSyJ
-yjkVa7aeMtcqTEiFL7Ae2EtiMhTrMrYpBDQ8rzm2i1IyTb9DX5v7DUOmrSynQSlV
-yXCztRVGNL/kHlItpEku1SHt/AD3ogu8EgqQZFB8xRRw9fubYgh4Q0kx80e4k9Qt
-TKncF3B2NGb/ZcE5Z+mmHIBq8J2zKMijOrdd3m5TbQmzDbETEOjs4L1eoZRLcL/c
-vYu5gmXdr4F7AgMBAAGjPTA7MBoGA1UdEQQTMBGCCWxvY2FsaG9zdIcEfwAAATAd
-BgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwDQYJKoZIhvcNAQEFBQADggEB
-ADQYaEjWlOb9YzUnFGjfDC06dRZjRmK8TW/4GiDHIDk5TyZ1ROtskvyhVyTZJ5Vs
-qXOKJwpps0jK2edtrvZ7xIGw+Y41oPgYYhr5TK2c+oi2UOHG4BXqRbuwz/5cU+nM
-ZWOG1OrHBCbrMSeFsn7rzETnd8SZnw6ZE7LI62WstdoCY0lvNfjNv3kY/6hpPm+9
-0bVzurZ28pdJ6YEJYgbPcOvxSzGDXTw9LaKEmqknTsrBKI2qm+myVTbRTimojYTo
-rw/xjHESAue/HkpOwWnFTOiTT+V4hZnDXygiSy+LWKP4zLnYOtsn0lN9OmD0z+aa
-gpoVMSncu2jMIDZX63IkQII=
------END CERTIFICATE-----
diff --git a/integration-tests/netty/README.adoc
b/integration-tests/netty/README.adoc
deleted file mode 100644
index 6f9d3fca63..0000000000
--- a/integration-tests/netty/README.adoc
+++ /dev/null
@@ -1,16 +0,0 @@
-== Regenerating Self Signed SSL Certificates
-
- cd src/main/resources/ssl
- keytool -genkeypair -keystore keystore.p12 -storetype PKCS12 -storepass
changeit -alias localhost -keyalg RSA -keysize 2048 -validity 99999 -dname
"CN=localhost"
-
-== Run tests on FIPS enabled system
-
-To execute the tests on FIPS enabled system add `-Dfips` property so that
tests will use BCFKS keystore. Example of usage:
-
-`mvn clean test -f integration-tests/netty/ -Dfips`
-
-
-=== Generate Bouncy Castle FIPS Keystore (BCFKS)
-
- cd src/main/resources/ssl
- keytool -genkey -alias localhost -keyalg RSA -keystore fips-keystore.bcfks
-keysize 2048 -validity 99999 -dname "CN=localhost" -keypass changeit -provider
org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider -providerpath
bc-fips.jar -storetype BCFKS
diff --git a/integration-tests/netty/pom.xml b/integration-tests/netty/pom.xml
index abaecb8f0c..0f53935043 100644
--- a/integration-tests/netty/pom.xml
+++ b/integration-tests/netty/pom.xml
@@ -66,6 +66,11 @@
<artifactId>camel-quarkus-integration-test-support</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
@@ -147,45 +152,6 @@
</dependency>
</dependencies>
</profile>
- <profile>
- <id>fips</id>
- <activation>
- <property>
- <name>fips</name>
- </property>
- </activation>
- <properties>
- <quarkus.profile>fips</quarkus.profile>
- <quarkus.test.profile>fips</quarkus.test.profile>
- </properties>
- <dependencies>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-security</artifactId>
- </dependency>
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bctls-fips</artifactId>
- </dependency>
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bc-fips</artifactId>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemPropertyVariables>
-
<quarkus.test.profile>fips</quarkus.test.profile>
- </systemPropertyVariables>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
</project>
diff --git
a/integration-tests/netty/src/main/java/org/apache/camel/quarkus/component/netty/NettyProducers.java
b/integration-tests/netty/src/main/java/org/apache/camel/quarkus/component/netty/NettyProducers.java
index 9a62ae32d5..2e37f92d36 100644
---
a/integration-tests/netty/src/main/java/org/apache/camel/quarkus/component/netty/NettyProducers.java
+++
b/integration-tests/netty/src/main/java/org/apache/camel/quarkus/component/netty/NettyProducers.java
@@ -130,15 +130,11 @@ public class NettyProducers {
@ConfigProperty(name = "keystore.type") Optional<String>
keystoreType,
@ConfigProperty(name = "keystore.provider") Optional<String>
keystoreProvider) {
KeyStoreParameters keystoreParameters = new KeyStoreParameters();
- keystoreParameters.setResource(keystore);
- keystoreType.ifPresent((it) -> keystoreParameters.setType(it));
- keystoreProvider.ifPresent((it) -> keystoreParameters.setProvider(it));
+ keystoreParameters.setResource("certs/netty-keystore.p12");
keystoreParameters.setPassword("changeit");
KeyStoreParameters truststoreParameters = new KeyStoreParameters();
- truststoreType.ifPresent((it) -> truststoreParameters.setType(it));
- truststoreProvider.ifPresent((it) ->
truststoreParameters.setProvider(it));
- truststoreParameters.setResource(truststore);
+ truststoreParameters.setResource("certs/netty-truststore.p12");
truststoreParameters.setPassword("changeit");
TrustManagersParameters trustManagersParameters = new
TrustManagersParameters();
diff --git a/integration-tests/netty/src/main/resources/application.properties
b/integration-tests/netty/src/main/resources/application.properties
index c7a6807b1f..1e2bcc156b 100644
--- a/integration-tests/netty/src/main/resources/application.properties
+++ b/integration-tests/netty/src/main/resources/application.properties
@@ -14,14 +14,6 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
-quarkus.native.resources.includes = ssl/*
-truststore.file=/ssl/truststore.jks
-keystore.file=/ssl/keystore.p12
-
-%fips.quarkus.security.security-providers=BCFIPSJSSE
-%fips.truststore.file=/ssl/fips-truststore.bcfks
-%fips.truststore.provider=BCFIPS
-%fips.truststore.type=BCFKS
-%fips.keystore.file=/ssl/fips-keystore.bcfks
-%fips.keystore.provider=BCFIPS
-%fips.keystore.type=BCFKS
+quarkus.native.resources.includes = certs/*
+truststore.file=/certs/netty-truststore.p12
+keystore.file=/certs/netty-keystore.p12
diff --git a/integration-tests/netty/src/main/resources/ssl/fips-keystore.bcfks
b/integration-tests/netty/src/main/resources/ssl/fips-keystore.bcfks
deleted file mode 100644
index 9b85476596..0000000000
Binary files
a/integration-tests/netty/src/main/resources/ssl/fips-keystore.bcfks and
/dev/null differ
diff --git
a/integration-tests/netty/src/main/resources/ssl/fips-truststore.bcfks
b/integration-tests/netty/src/main/resources/ssl/fips-truststore.bcfks
deleted file mode 100644
index e74b445b29..0000000000
Binary files
a/integration-tests/netty/src/main/resources/ssl/fips-truststore.bcfks and
/dev/null differ
diff --git a/integration-tests/netty/src/main/resources/ssl/keystore.p12
b/integration-tests/netty/src/main/resources/ssl/keystore.p12
deleted file mode 100644
index 36cc5db567..0000000000
Binary files a/integration-tests/netty/src/main/resources/ssl/keystore.p12 and
/dev/null differ
diff --git a/integration-tests/netty/src/main/resources/ssl/truststore.jks
b/integration-tests/netty/src/main/resources/ssl/truststore.jks
deleted file mode 100644
index 962450331a..0000000000
Binary files a/integration-tests/netty/src/main/resources/ssl/truststore.jks
and /dev/null differ
diff --git
a/integration-tests/netty/src/test/java/org/apache/camel/quarkus/component/netty/tcp/NettyTcpTest.java
b/integration-tests/netty/src/test/java/org/apache/camel/quarkus/component/netty/tcp/NettyTcpTest.java
index b3148b8555..defc4b2023 100644
---
a/integration-tests/netty/src/test/java/org/apache/camel/quarkus/component/netty/tcp/NettyTcpTest.java
+++
b/integration-tests/netty/src/test/java/org/apache/camel/quarkus/component/netty/tcp/NettyTcpTest.java
@@ -21,10 +21,16 @@ import java.io.IOException;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import static org.hamcrest.Matchers.is;
+@TestCertificates(certificates = {
+ @Certificate(name = "netty", formats = {
+ Format.PKCS12 }, password = "changeit") })
@QuarkusTest
@QuarkusTestResource(NettyTcpTestResource.class)
class NettyTcpTest {
diff --git
a/integration-tests/netty/src/test/java/org/apache/camel/quarkus/component/netty/udp/NettyUdpTest.java
b/integration-tests/netty/src/test/java/org/apache/camel/quarkus/component/netty/udp/NettyUdpTest.java
index 7bc9a69f47..72ac2842c8 100644
---
a/integration-tests/netty/src/test/java/org/apache/camel/quarkus/component/netty/udp/NettyUdpTest.java
+++
b/integration-tests/netty/src/test/java/org/apache/camel/quarkus/component/netty/udp/NettyUdpTest.java
@@ -21,10 +21,16 @@ import java.io.IOException;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import static org.hamcrest.Matchers.is;
+@TestCertificates(certificates = {
+ @Certificate(name = "netty", formats = {
+ Format.PKCS12 }, password = "changeit") })
@QuarkusTest
@QuarkusTestResource(NettyUdpTestResource.class)
class NettyUdpTest {
diff --git a/integration-tests/oaipmh/pom.xml b/integration-tests/oaipmh/pom.xml
index dd10e5b8f8..4d4f925b30 100644
--- a/integration-tests/oaipmh/pom.xml
+++ b/integration-tests/oaipmh/pom.xml
@@ -82,6 +82,11 @@
<artifactId>wiremock-standalone</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
diff --git
a/integration-tests/oaipmh/src/test/java/org/apache/camel/quarkus/component/oaipmh/it/MockOaipmhServer.java
b/integration-tests/oaipmh/src/test/java/org/apache/camel/quarkus/component/oaipmh/it/MockOaipmhServer.java
index e5e6b51c50..0e3ebaf795 100644
---
a/integration-tests/oaipmh/src/test/java/org/apache/camel/quarkus/component/oaipmh/it/MockOaipmhServer.java
+++
b/integration-tests/oaipmh/src/test/java/org/apache/camel/quarkus/component/oaipmh/it/MockOaipmhServer.java
@@ -42,7 +42,7 @@ import static
com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMoc
public final class MockOaipmhServer {
private static Map<String, String> responseCache;
- private static final String PASSWORD = "changeit";
+ static final String PASSWORD = "changeit";
private int httpPort;
private int httpsPort;
@@ -91,7 +91,7 @@ public final class MockOaipmhServer {
WireMockConfiguration config =
wireMockConfig().extensions(transformer);
config.httpsPort(httpsPort);
- String keyStorePath =
MockOaipmhServer.class.getResource("/jettyKS/localhost.p12").toExternalForm();
+ String keyStorePath =
MockOaipmhServer.class.getResource("/certs/oaipmh-keystore.p12").toExternalForm();
config.keystorePath(keyStorePath);
config.keystorePassword(PASSWORD);
config.keyManagerPassword(PASSWORD);
diff --git
a/integration-tests/oaipmh/src/test/java/org/apache/camel/quarkus/component/oaipmh/it/OaipmhTest.java
b/integration-tests/oaipmh/src/test/java/org/apache/camel/quarkus/component/oaipmh/it/OaipmhTest.java
index 8d67cfe3e0..40da1ffe67 100644
---
a/integration-tests/oaipmh/src/test/java/org/apache/camel/quarkus/component/oaipmh/it/OaipmhTest.java
+++
b/integration-tests/oaipmh/src/test/java/org/apache/camel/quarkus/component/oaipmh/it/OaipmhTest.java
@@ -20,6 +20,9 @@ import java.util.concurrent.TimeUnit;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import static io.restassured.RestAssured.get;
@@ -27,6 +30,9 @@ import static io.restassured.RestAssured.given;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.Matchers.is;
+@TestCertificates(certificates = {
+ @Certificate(name = "oaipmh", formats = {
+ Format.PKCS12 }, password = MockOaipmhServer.PASSWORD) })
@QuarkusTest
@QuarkusTestResource(OaipmhTestResource.class)
class OaipmhTest {
diff --git a/integration-tests/oaipmh/src/test/resources/jettyKS/localhost.p12
b/integration-tests/oaipmh/src/test/resources/jettyKS/localhost.p12
deleted file mode 100644
index 5f6a30d069..0000000000
Binary files
a/integration-tests/oaipmh/src/test/resources/jettyKS/localhost.p12 and
/dev/null differ
diff --git a/integration-tests/paho-mqtt5/pom.xml
b/integration-tests/paho-mqtt5/pom.xml
index 0f609d8638..2508159c73 100644
--- a/integration-tests/paho-mqtt5/pom.xml
+++ b/integration-tests/paho-mqtt5/pom.xml
@@ -80,6 +80,11 @@
<artifactId>camel-quarkus-integration-test-support</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
diff --git
a/integration-tests/paho-mqtt5/src/main/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Resource.java
b/integration-tests/paho-mqtt5/src/main/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Resource.java
index ef86d06a0b..f6df2cc43b 100644
---
a/integration-tests/paho-mqtt5/src/main/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Resource.java
+++
b/integration-tests/paho-mqtt5/src/main/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Resource.java
@@ -68,8 +68,8 @@ public class PahoMqtt5Resource {
@Inject
ConsumerTemplate consumerTemplate;
- private final String keystore = "clientkeystore.jks";
- private final String password = "quarkus";
+ private final String keystore = "certs/paho-mqtt5-keystore.p12";
+ public final static String KEYSTORE_PASSWORD = "quarkus";
@Path("/{protocol}/{queueName}")
@GET
@@ -87,9 +87,9 @@ public class PahoMqtt5Resource {
sslClientProps = "&httpsHostnameVerificationEnabled=false" +
"&sslHostnameVerifier=#hostnameVerifier" +
"&sslClientProps.com.ibm.ssl.keyStore=" + tmpKeystore +
- "&sslClientProps.com.ibm.ssl.keyStorePassword=" +
password +
+ "&sslClientProps.com.ibm.ssl.keyStorePassword=" +
KEYSTORE_PASSWORD +
"&sslClientProps.com.ibm.ssl.trustStore=" +
tmpKeystore +
- "&sslClientProps.com.ibm.ssl.trustStorePassword=" +
password;
+ "&sslClientProps.com.ibm.ssl.trustStorePassword=" +
KEYSTORE_PASSWORD;
}
result = consumerTemplate.receiveBody(
"paho-mqtt5:" + queueName + "?brokerUrl=" +
brokerUrl(protocol) + sslClientProps, 5000,
@@ -118,9 +118,9 @@ public class PahoMqtt5Resource {
sslClientProps = "&httpsHostnameVerificationEnabled=false" +
"&sslHostnameVerifier=#hostnameVerifier" +
"&sslClientProps.com.ibm.ssl.keyStore=" + tmpKeystore +
- "&sslClientProps.com.ibm.ssl.keyStorePassword=" +
password +
+ "&sslClientProps.com.ibm.ssl.keyStorePassword=" +
KEYSTORE_PASSWORD +
"&sslClientProps.com.ibm.ssl.trustStore=" +
tmpKeystore +
- "&sslClientProps.com.ibm.ssl.trustStorePassword=" +
password;
+ "&sslClientProps.com.ibm.ssl.trustStorePassword=" +
KEYSTORE_PASSWORD;
}
producerTemplate.sendBody(
"paho-mqtt5:" + queueName + "?retained=true&brokerUrl=" +
brokerUrl(protocol) + sslClientProps, message);
diff --git
a/integration-tests/paho-mqtt5/src/main/resources/application.properties
b/integration-tests/paho-mqtt5/src/main/resources/application.properties
index 7db61c14ab..2a135a0477 100644
--- a/integration-tests/paho-mqtt5/src/main/resources/application.properties
+++ b/integration-tests/paho-mqtt5/src/main/resources/application.properties
@@ -14,4 +14,4 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
-quarkus.native.resources.includes=*.jks
+quarkus.native.resources.includes=certs/*.p12
diff --git a/integration-tests/paho-mqtt5/src/main/resources/clientkeystore.jks
b/integration-tests/paho-mqtt5/src/main/resources/clientkeystore.jks
deleted file mode 100644
index 51643f16d0..0000000000
Binary files
a/integration-tests/paho-mqtt5/src/main/resources/clientkeystore.jks and
/dev/null differ
diff --git
a/integration-tests/paho-mqtt5/src/test/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Test.java
b/integration-tests/paho-mqtt5/src/test/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Test.java
index 528c0b3ac5..dcc9da8bdf 100644
---
a/integration-tests/paho-mqtt5/src/test/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Test.java
+++
b/integration-tests/paho-mqtt5/src/test/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5Test.java
@@ -20,12 +20,19 @@ import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import static org.hamcrest.core.Is.is;
+@TestCertificates(certificates = {
+ @Certificate(name = "paho-mqtt5", formats = {
+ Format.PKCS12, Format.PEM }, password =
PahoMqtt5Resource.KEYSTORE_PASSWORD)
+}, docker = true)
@QuarkusTest
@QuarkusTestResource(PahoMqtt5TestResource.class)
class PahoMqtt5Test {
diff --git
a/integration-tests/paho-mqtt5/src/test/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5TestResource.java
b/integration-tests/paho-mqtt5/src/test/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5TestResource.java
index 2a22a98ee5..602502c37b 100644
---
a/integration-tests/paho-mqtt5/src/test/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5TestResource.java
+++
b/integration-tests/paho-mqtt5/src/test/java/org/apache/camel/quarkus/component/paho/mqtt5/it/PahoMqtt5TestResource.java
@@ -84,9 +84,11 @@ public class PahoMqtt5TestResource implements
QuarkusTestResourceLifecycleManage
.withExposedPorts(TCP_PORT, WS_PORT, SSL_PORT)
.withClasspathResourceMapping("mosquitto.conf",
"/mosquitto/config/mosquitto.conf", BindMode.READ_ONLY)
.withClasspathResourceMapping("password.conf",
"/etc/mosquitto/password", BindMode.READ_ONLY)
- .withClasspathResourceMapping("certs/ca.pem",
"/etc/mosquitto/certs/ca.pem", BindMode.READ_ONLY)
- .withClasspathResourceMapping("certs/server.pem",
"/etc/mosquitto/certs/server.pem", BindMode.READ_ONLY)
- .withClasspathResourceMapping("certs/server.key",
"/etc/mosquitto/certs/server.key",
+
.withClasspathResourceMapping("certs/paho-mqtt5-ca.crt",
"/etc/mosquitto/certs/paho-mqtt5-ca.crt",
+ BindMode.READ_ONLY)
+ .withClasspathResourceMapping("certs/paho-mqtt5.crt",
"/etc/mosquitto/certs/paho-mqtt5.crt",
+ BindMode.READ_ONLY)
+ .withClasspathResourceMapping("certs/paho-mqtt5.key",
"/etc/mosquitto/certs/paho-mqtt5.key",
BindMode.READ_ONLY);
}
diff --git a/integration-tests/paho-mqtt5/src/test/resources/certs/ca.key
b/integration-tests/paho-mqtt5/src/test/resources/certs/ca.key
deleted file mode 100644
index cd4cae6986..0000000000
--- a/integration-tests/paho-mqtt5/src/test/resources/certs/ca.key
+++ /dev/null
@@ -1,30 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,82C51D0B8CD84E74
-
-ParQZs7HrK6hAcDEY3OyqN2PAFEDwfpeV/43XYNr2b+tdG4TqnQ+liMiDPOJ3nSR
-luNu9Y57N/EPtjfVPCj46fNPtuYotWwxUO1Nq9fZ8Y3JjAGE0f77bDAduMIIH6aL
-oubriZ44Uav3TqBhAc7H7pdmdthuSX9wGHQ3FHWHoxS+zkTe01Lp8OYFP3aJggpR
-gFfZF+S+rUKRV1AnMBV6Eytfu5magM5qTqZ10/R0VtuN3b0vlh72WhIakXnf7orG
-P9/tRY3jl4z/ZB9q62FN6xlJSKZKXYdPQ8uYpK7z278ZGfoSsmLhXc5yAg4wnCxa
-FmsirKvmohhDnrCEuIk47RtV7S6XbYQAcDnmwYNY5qvCDTWxaCVzxJe4WcJyHaq1
-MWj/SQn8sIQcTA0XPGh/fzJ6LLJgpWV+P9T3hgBRYUoLIGd+zxxaOd+KxOdHmvsU
-sqV8v4O4KmYWKYIgaamiUHb/ahc/YKnzj9toTi3dYuZbOY6EnBvMX0+VfckGG86f
-Xn+st7/ZtylJN2O1o+BKMYwqOKhZOTzzqgLZeDuHa7AyCAyBdh7+Bw5ZHVpFrUcp
-ciNpNS8ywlgEibdIvBl/uIs/IL8uKvL7fZu6tsR/nbuhG/0THnhZtDILP04v75Oh
-h5eN/JU8NqxuykfpP6C+KjerrR/+ExEJJ8wivEDRYF4vzY9+vjNdo7+Yh4yRSwgr
-FxML9bC4CpR8zwvhhBmD6SzDvoKqM+vFnQr+g1/dFku7RCd/GeXTVK9tBJIr3974
-8BJ0j1wmJJyOaKIX+nwX/ptLiM9e9Yj7RkcOX7+V1QI9rs2f5LalXY8mulkg3tVK
-axz49F7G5vV8ODLVqXoPZqZGNtEA9J84FGkfvAb2VqlAd1Bmv7Pwv/w3i5ldRxq4
-mCVY9Pm7VEi5qunV4fBHAHQNLMy899Cu/OGXEb0ZZ+JqgKnXKXyhPHBouTDI4mZ2
-81AqS0u3/11J82SCgtwICApWCpu1T9LWYt67kZ3hteI4Vy9j9d251eCArD/HoOJe
-TCcfBAnNt2z2Ji0hKAqQQld3AV9800CAFifhAPb0/3KB48itNfhNHNIjFgym0puc
-M8VaF5oBS2g36tay9lGEiSs9u1lojRoaFB4avL4oCdFXgAWNkrO0dtZhhj65q3HP
-i0GRhCTKzQdIp6forBdMrz/oFMr117MsSdnXUd+78NKiczZMBYaoZOonmKQ1gkwe
-hePqXy+QcOowPaNOdq+T7QpBX3C7tr52lnqQ26zvaspnDOkcYZZ27JjwM619JDvh
-uAB7q8iySt985KKafN2rIY/5mVE7Nl/06m0lqzpd6aju5jmf8pUYcG2sdV509KQg
-6ZRDZELizd2T/QwhGPKSAQBfF9CgqgWUBSeMtX1gbIShbf7hycPj1SmPMGzUUn+3
-hZ1Qtou2GdtHNQj1jSlHi8YVX7qM8tfAGDZnQ+30Dx0a03uKuieN/h6VACb9fkOI
-TErii3pNuW5M/p4DPSXwW1cwQFpxs2FTZKyn7QBBPSSxymEK3mirZjFiKhtKxj/C
-E64mtbZxdPH9tzO2WiqfHW1St7XmP1FshDfaQsOOMmq0l0giluc9Lg==
------END RSA PRIVATE KEY-----
diff --git a/integration-tests/paho-mqtt5/src/test/resources/certs/ca.pem
b/integration-tests/paho-mqtt5/src/test/resources/certs/ca.pem
deleted file mode 100644
index bc257a93eb..0000000000
--- a/integration-tests/paho-mqtt5/src/test/resources/certs/ca.pem
+++ /dev/null
@@ -1,22 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDqzCCApOgAwIBAgIUU/uMzfEhx21GXTOErSxGfoqt7qUwDQYJKoZIhvcNAQEL
-BQAwZTELMAkGA1UEBhMCQ04xEDAOBgNVBAgMB0JlaWppbmcxFTATBgNVBAcMDERl
-ZmF1bHQgQ2l0eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0ZDEPMA0GA1UE
-AwwGdGVzdENBMB4XDTIyMDQwMTA1NDEwMloXDTI3MDMzMTA1NDEwMlowZTELMAkG
-A1UEBhMCQ04xEDAOBgNVBAgMB0JlaWppbmcxFTATBgNVBAcMDERlZmF1bHQgQ2l0
-eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0ZDEPMA0GA1UEAwwGdGVzdENB
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyfqvVSox1n+5OBhCZC1C
-OKpLVKEIalvxOQ5ezDcAeqUXfNJloP+7YeAylpOEiuxVlCvy4UScxUb98isr8Q0W
-3hNIc1O/FNJfnOPEJoaJCGb0Uq0Mq4CaZonkN8/2nolPIC8yg2b2/mIa4ZJhH94x
-KNzSiKfBMEqv8f3iGi8RhHrcMZAMosbIWZ1fIRhciJDa1xvsSFZz/gOq/D+YC/ST
-MjgTm7q1HXugHDtTFNw0XO3iY7co13fZBJjGu8AqW1K8CFZEBoJlsTByvkkEYzf4
-OMjwKO6v9dc4spRY32v7Nt8zrTz4Hg4g2QrvJWacYfi3eHkoMTdJFMVGE6COo3dS
-VwIDAQABo1MwUTAdBgNVHQ4EFgQUbkVV4nft2UZ3SqcaZqftJFleKtIwHwYDVR0j
-BBgwFoAUbkVV4nft2UZ3SqcaZqftJFleKtIwDwYDVR0TAQH/BAUwAwEB/zANBgkq
-hkiG9w0BAQsFAAOCAQEAVnGMYzl1xX5UHSTpGwpu+twd0GntIw8eSBZkLHp2GJdG
-Xh1uozTq9UTwT7F/2zCcOFhCzTZi18cK0sHBb53yS6gK5HEarZvUyqFqmXNljJxi
-I2sw640O1rAygM6lpth5Kt7038lr5MgFccU0/2AKbQUyW7tUwupf4nQACh+1xQ3J
-m+jF050eJQTtApnRuUU+XF7ITYPANJPofa9rrfbP76LQk94De3PJP5Ijll+bgjs/
-7H1hm5PFaTF3zj86i77O7Ru63T8BajolosVVWcUSmtxa/zMRLNVSLncQd40bRl1i
-mxfKR5assb31p+U/c1NH5yLtburJcB3GPyMdsmeO0w==
------END CERTIFICATE-----
diff --git a/integration-tests/paho-mqtt5/src/test/resources/certs/server.key
b/integration-tests/paho-mqtt5/src/test/resources/certs/server.key
deleted file mode 100644
index 4dd056694e..0000000000
--- a/integration-tests/paho-mqtt5/src/test/resources/certs/server.key
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEAw/UF6GOP/oy8vlzPzgRdtaoLeYnGW+DGYnbdv3qY4LWpI+BE
-MqprVUC69jvgNzwgRXmudx1DM68u1HWvXR7yA2hHPJqshlPplqeRarX7i9QwrdTg
-FimEuw3BKeYjgqE9ddtYyDTcVF6mncRB6t4S9VrkuVBlIukt0lfZVs2JuaNKpRpc
-/mQ04DcdA8QrEXTPDzpirCTC61p2OsyldhmkbvS9UpV4ur6lkCS4KJ8VZLGdJeSk
-TGI7qOe6WJS859ukmgZjnaHuEcFzLcb0ywDubsO1q+dNaKyD8ju3GFJi2LnFKwlk
-N7w+b/zq8XmAIKvp6q2AvG/jpgmVmSSrKfwSsQIDAQABAoIBAQCr/4Fz/RAC6h0x
-Kd3sgsCOF/eCcn/9XUpEWvlAfKd7dXhE2TCDGDql1e9E+kFPuiLJWIjeXH0D/Jwq
-ODH4lpTukLUWaN1N+pFpfyOQerOUhGdF7TfTvBWY6fXGhQ5eNpDvxdwjvuI12+57
-RCxnrw0M9v8T+ZEMF4f0vM8z9a0Rls097a246yAn040SjMJm4+FKWLB2/KXvh/nl
-xOFk81TKl6f7/Sx+GKCOSLasdAwp5G/8uyzNH0i2q9yPkw/OR3QutntBphBq+RGH
-pEBwshQNOwAwKlkIYiYv+KEZiL3JAZdPiV5p9HOIKtaIjzGZOFJqv/fZJLJDJZHu
-FUwO8u1RAoGBAOVX6rW8Nnf3jh1ZqZu6Qr2bHT8p41k57m5airBqlqzFZesSwErO
-X2utli11j+thZSuFG+pH70MTH2f3Me4AhOVO2wrllzo8ygjymjTWYm0217g5dYWy
-NLqhRlD2FEKdXpfTIUYc52cbYEG4/q9L2MKBws/S6cKJZN5le8LsNrVHAoGBANq7
-s4JGEsgzEhx1IwdygqdZHkiE4plmT1i4ufogw1jLl4hN8ajF6pAHuF7ZiJDlQ+QR
-M+tFrC0XEg7c23M9LgrnXRMUbKvjTsN3OnTZCKZ/U7Gimnfu4j6Lwu13l3AZLjWv
-6cOx+B3bO31caa5rbsrCJNYTiFJQtn6Kuq5eR9RHAoGANbS/1u0LSE6lbgQYLsqQ
-ZHxVffweLD/fsOHtBmD/hdf4BPNwKlRnjfypZV3ZZQJ6wZU7M0LDKc7plNwTSiu+
-8z/jFYssPcwMd8nwCJ2HkRG9tHtoJPXVWTr5D26A0hSuGRms+hE8sy16/gkHQx+c
-0/e1GhvG9/Jat6XGNKBCM3MCgYB9jVRCqNpLFBWHRC1xLueUC3F4it5O0w0kjhQi
-YQAATgyS7rqR99jmB6hquU7MbO0FUmKM35cu4pk48sj8Yte05ozkUMr39yfUxvFE
-9PckKt3tjro/sV0oLa0cBZNlgu6lXm4+KD+VU6vYD12SApS7yai/QML1DONTy2nQ
-gMmWLQKBgA3Nb5bFkb6NPHtb7JhJLB2/veuhOGN3yEEs1GFjLF5sgR8Fq+R84tWM
-tGE9mqHGkhvrTlgAdY8DRZjcBg0VimUnXNCRn5wXmhcFs44zsprdr8+2Srcit6n4
-j/6HocZNXy46lBAFY7PYUYDfDSbyFRMfx3l34lV+tc9iM8HaWfev
------END RSA PRIVATE KEY-----
diff --git a/integration-tests/paho-mqtt5/src/test/resources/certs/server.pem
b/integration-tests/paho-mqtt5/src/test/resources/certs/server.pem
deleted file mode 100644
index ddad4073b4..0000000000
--- a/integration-tests/paho-mqtt5/src/test/resources/certs/server.pem
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDVDCCAjwCFD0B2OCkiJZYwb3trDFCX7mQ9wc1MA0GCSqGSIb3DQEBCwUAMGUx
-CzAJBgNVBAYTAkNOMRAwDgYDVQQIDAdCZWlqaW5nMRUwEwYDVQQHDAxEZWZhdWx0
-IENpdHkxHDAaBgNVBAoME0RlZmF1bHQgQ29tcGFueSBMdGQxDzANBgNVBAMMBnRl
-c3RDQTAeFw0yMjA0MDExMTQwMTBaFw0zMjAzMjkxMTQwMTBaMGgxCzAJBgNVBAYT
-AkNOMRAwDgYDVQQIDAdCZWlqaW5nMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAa
-BgNVBAoME0RlZmF1bHQgQ29tcGFueSBMdGQxEjAQBgNVBAMMCWxvY2FsaG9zdDCC
-ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMP1Behjj/6MvL5cz84EXbWq
-C3mJxlvgxmJ23b96mOC1qSPgRDKqa1VAuvY74Dc8IEV5rncdQzOvLtR1r10e8gNo
-RzyarIZT6ZankWq1+4vUMK3U4BYphLsNwSnmI4KhPXXbWMg03FRepp3EQereEvVa
-5LlQZSLpLdJX2VbNibmjSqUaXP5kNOA3HQPEKxF0zw86YqwkwutadjrMpXYZpG70
-vVKVeLq+pZAkuCifFWSxnSXkpExiO6jnuliUvOfbpJoGY52h7hHBcy3G9MsA7m7D
-tavnTWisg/I7txhSYti5xSsJZDe8Pm/86vF5gCCr6eqtgLxv46YJlZkkqyn8ErEC
-AwEAATANBgkqhkiG9w0BAQsFAAOCAQEAHFNHzAEW5x2A6dSoxopTR/SB1ffGnhfs
-6mkMBFppYYCYwJyWSgnWYsBB/m2xakyCpup1mPT6AAb8NiS2c0R9dEQsEtgwwc/j
-6KihqXSVBmux7pvMc6vLwGVYlHH7oAodS+ZPQUSs0wii++NzugRsHwwIdvGpUbVg
-Tc8VAiDHYG7z88l/m5zWsKMQp8FK1PyhTL0eDGK8eCfuWTfM2lf7ITuAjhKXLbPY
-/vHTp13/+IfuAREcl73iXm57epIgG715T6J3+jdxyqzKdkx2vkEo3dUWusu7WR73
-PsYsjXPTOI2/zUkkiVqwwIiVOLR9E332aOxeqZaqLBrYze9PHB1lPg==
------END CERTIFICATE-----
diff --git a/integration-tests/paho-mqtt5/src/test/resources/mosquitto.conf
b/integration-tests/paho-mqtt5/src/test/resources/mosquitto.conf
index 921dc8fc27..bbc5bc1ba9 100644
--- a/integration-tests/paho-mqtt5/src/test/resources/mosquitto.conf
+++ b/integration-tests/paho-mqtt5/src/test/resources/mosquitto.conf
@@ -6,9 +6,9 @@ protocol mqtt
listener 8883
protocol mqtt
-cafile /etc/mosquitto/certs/ca.pem
-certfile /etc/mosquitto/certs/server.pem
-keyfile /etc/mosquitto/certs/server.key
+cafile /etc/mosquitto/certs/paho-mqtt5-ca.crt
+certfile /etc/mosquitto/certs/paho-mqtt5.crt
+keyfile /etc/mosquitto/certs/paho-mqtt5.key
listener 9001
protocol websockets
diff --git a/integration-tests/paho/pom.xml b/integration-tests/paho/pom.xml
index 4ad49d425b..81d45f237e 100644
--- a/integration-tests/paho/pom.xml
+++ b/integration-tests/paho/pom.xml
@@ -56,6 +56,11 @@
<artifactId>camel-quarkus-integration-tests-support-activemq</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
diff --git
a/integration-tests/paho/src/main/java/org/apache/camel/quarkus/component/paho/PahoResource.java
b/integration-tests/paho/src/main/java/org/apache/camel/quarkus/component/paho/PahoResource.java
index 8250e0141e..9c0efbf7f9 100644
---
a/integration-tests/paho/src/main/java/org/apache/camel/quarkus/component/paho/PahoResource.java
+++
b/integration-tests/paho/src/main/java/org/apache/camel/quarkus/component/paho/PahoResource.java
@@ -57,8 +57,8 @@ public class PahoResource {
@Inject
ConsumerTemplate consumerTemplate;
- private static final String KEYSTORE_FILE = "clientkeystore.jks";
- private static final String KEYSTORE_PASSWORD = "quarkus";
+ private static final String KEYSTORE_FILE = "certs/paho-keystore.p12";
+ public static final String KEYSTORE_PASSWORD = "quarkus";
@Path("/{protocol}/{queueName}")
@GET
@@ -176,7 +176,7 @@ public class PahoResource {
private java.nio.file.Path copyKeyStore() {
java.nio.file.Path tmpKeystore = null;
try (InputStream in =
Thread.currentThread().getContextClassLoader().getResourceAsStream(KEYSTORE_FILE);)
{
- tmpKeystore = Files.createTempFile("keystore-", ".jks");
+ tmpKeystore = Files.createTempFile("keystore-", ".p12");
Files.copy(in, tmpKeystore, StandardCopyOption.REPLACE_EXISTING);
return tmpKeystore;
} catch (Exception e) {
diff --git a/integration-tests/paho/src/main/resources/application.properties
b/integration-tests/paho/src/main/resources/application.properties
index cc4b9d1c89..403573f993 100644
--- a/integration-tests/paho/src/main/resources/application.properties
+++ b/integration-tests/paho/src/main/resources/application.properties
@@ -14,4 +14,4 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
-quarkus.native.resources.includes=*.jks
\ No newline at end of file
+quarkus.native.resources.includes=certs/*.p12
\ No newline at end of file
diff --git a/integration-tests/paho/src/main/resources/clientkeystore.jks
b/integration-tests/paho/src/main/resources/clientkeystore.jks
deleted file mode 100644
index 51643f16d0..0000000000
Binary files a/integration-tests/paho/src/main/resources/clientkeystore.jks and
/dev/null differ
diff --git
a/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/PahoTest.java
b/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/PahoTest.java
index 7da88ec23b..bab923dedc 100644
---
a/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/PahoTest.java
+++
b/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/PahoTest.java
@@ -20,6 +20,10 @@ import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.component.paho.PahoResource;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@@ -27,6 +31,10 @@ import org.junit.jupiter.params.provider.ValueSource;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.StringRegularExpression.matchesRegex;
+@TestCertificates(certificates = {
+ @Certificate(name = "paho", formats = {
+ Format.PKCS12, Format.PEM }, password =
PahoResource.KEYSTORE_PASSWORD)
+}, docker = true)
@QuarkusTest
@QuarkusTestResource(PahoTestResource.class)
class PahoTest {
diff --git
a/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/PahoTestResource.java
b/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/PahoTestResource.java
index 1070489fc3..5019578c08 100644
---
a/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/PahoTestResource.java
+++
b/integration-tests/paho/src/test/java/org/apache/camel/quarkus/component/paho/it/PahoTestResource.java
@@ -21,7 +21,6 @@ import java.util.Map;
import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
import org.apache.camel.util.CollectionHelper;
-import org.eclipse.microprofile.config.ConfigProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.BindMode;
@@ -32,7 +31,8 @@ import org.testcontainers.utility.TestcontainersConfiguration;
public class PahoTestResource implements QuarkusTestResourceLifecycleManager {
private static final Logger LOGGER =
LoggerFactory.getLogger(PahoTestResource.class);
- private static final String IMAGE =
ConfigProvider.getConfig().getValue("eclipse-mosquitto.container.image",
String.class);
+ // private static final String IMAGE =
ConfigProvider.getConfig().getValue("eclipse-mosquitto.container.image",
String.class);
+ private static final String IMAGE = "docker.io/eclipse-mosquitto:2.0.18";
private static final int TCP_PORT = 1883;
private static final int SSL_PORT = 8883;
private static final int WS_PORT = 9001;
@@ -51,10 +51,9 @@ public class PahoTestResource implements
QuarkusTestResourceLifecycleManager {
container = new
GenericContainer<>(IMAGE).withExposedPorts(TCP_PORT, WS_PORT, SSL_PORT)
.withClasspathResourceMapping("mosquitto.conf",
"/mosquitto/config/mosquitto.conf", BindMode.READ_ONLY)
.withClasspathResourceMapping("password.conf",
"/etc/mosquitto/password", BindMode.READ_ONLY)
- .withClasspathResourceMapping("certs/ca.pem",
"/etc/mosquitto/certs/ca.pem", BindMode.READ_ONLY)
- .withClasspathResourceMapping("certs/server.pem",
"/etc/mosquitto/certs/server.pem", BindMode.READ_ONLY)
- .withClasspathResourceMapping("certs/server.key",
"/etc/mosquitto/certs/server.key", BindMode.READ_ONLY);
-
+ .withClasspathResourceMapping("certs/paho-ca.crt",
"/etc/mosquitto/certs/paho-ca.crt", BindMode.READ_ONLY)
+ .withClasspathResourceMapping("certs/paho.crt",
"/etc/mosquitto/certs/paho.crt", BindMode.READ_ONLY)
+ .withClasspathResourceMapping("certs/paho.key",
"/etc/mosquitto/certs/paho.key", BindMode.READ_ONLY);
container.withLogConsumer(new Slf4jLogConsumer(LOGGER))
.waitingFor(Wait.forLogMessage(".* mosquitto version .*
running", 1)).waitingFor(Wait.forListeningPort());
diff --git a/integration-tests/paho/src/test/resources/certs/ca.key
b/integration-tests/paho/src/test/resources/certs/ca.key
deleted file mode 100644
index cd4cae6986..0000000000
--- a/integration-tests/paho/src/test/resources/certs/ca.key
+++ /dev/null
@@ -1,30 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,82C51D0B8CD84E74
-
-ParQZs7HrK6hAcDEY3OyqN2PAFEDwfpeV/43XYNr2b+tdG4TqnQ+liMiDPOJ3nSR
-luNu9Y57N/EPtjfVPCj46fNPtuYotWwxUO1Nq9fZ8Y3JjAGE0f77bDAduMIIH6aL
-oubriZ44Uav3TqBhAc7H7pdmdthuSX9wGHQ3FHWHoxS+zkTe01Lp8OYFP3aJggpR
-gFfZF+S+rUKRV1AnMBV6Eytfu5magM5qTqZ10/R0VtuN3b0vlh72WhIakXnf7orG
-P9/tRY3jl4z/ZB9q62FN6xlJSKZKXYdPQ8uYpK7z278ZGfoSsmLhXc5yAg4wnCxa
-FmsirKvmohhDnrCEuIk47RtV7S6XbYQAcDnmwYNY5qvCDTWxaCVzxJe4WcJyHaq1
-MWj/SQn8sIQcTA0XPGh/fzJ6LLJgpWV+P9T3hgBRYUoLIGd+zxxaOd+KxOdHmvsU
-sqV8v4O4KmYWKYIgaamiUHb/ahc/YKnzj9toTi3dYuZbOY6EnBvMX0+VfckGG86f
-Xn+st7/ZtylJN2O1o+BKMYwqOKhZOTzzqgLZeDuHa7AyCAyBdh7+Bw5ZHVpFrUcp
-ciNpNS8ywlgEibdIvBl/uIs/IL8uKvL7fZu6tsR/nbuhG/0THnhZtDILP04v75Oh
-h5eN/JU8NqxuykfpP6C+KjerrR/+ExEJJ8wivEDRYF4vzY9+vjNdo7+Yh4yRSwgr
-FxML9bC4CpR8zwvhhBmD6SzDvoKqM+vFnQr+g1/dFku7RCd/GeXTVK9tBJIr3974
-8BJ0j1wmJJyOaKIX+nwX/ptLiM9e9Yj7RkcOX7+V1QI9rs2f5LalXY8mulkg3tVK
-axz49F7G5vV8ODLVqXoPZqZGNtEA9J84FGkfvAb2VqlAd1Bmv7Pwv/w3i5ldRxq4
-mCVY9Pm7VEi5qunV4fBHAHQNLMy899Cu/OGXEb0ZZ+JqgKnXKXyhPHBouTDI4mZ2
-81AqS0u3/11J82SCgtwICApWCpu1T9LWYt67kZ3hteI4Vy9j9d251eCArD/HoOJe
-TCcfBAnNt2z2Ji0hKAqQQld3AV9800CAFifhAPb0/3KB48itNfhNHNIjFgym0puc
-M8VaF5oBS2g36tay9lGEiSs9u1lojRoaFB4avL4oCdFXgAWNkrO0dtZhhj65q3HP
-i0GRhCTKzQdIp6forBdMrz/oFMr117MsSdnXUd+78NKiczZMBYaoZOonmKQ1gkwe
-hePqXy+QcOowPaNOdq+T7QpBX3C7tr52lnqQ26zvaspnDOkcYZZ27JjwM619JDvh
-uAB7q8iySt985KKafN2rIY/5mVE7Nl/06m0lqzpd6aju5jmf8pUYcG2sdV509KQg
-6ZRDZELizd2T/QwhGPKSAQBfF9CgqgWUBSeMtX1gbIShbf7hycPj1SmPMGzUUn+3
-hZ1Qtou2GdtHNQj1jSlHi8YVX7qM8tfAGDZnQ+30Dx0a03uKuieN/h6VACb9fkOI
-TErii3pNuW5M/p4DPSXwW1cwQFpxs2FTZKyn7QBBPSSxymEK3mirZjFiKhtKxj/C
-E64mtbZxdPH9tzO2WiqfHW1St7XmP1FshDfaQsOOMmq0l0giluc9Lg==
------END RSA PRIVATE KEY-----
diff --git a/integration-tests/paho/src/test/resources/certs/ca.pem
b/integration-tests/paho/src/test/resources/certs/ca.pem
deleted file mode 100644
index bc257a93eb..0000000000
--- a/integration-tests/paho/src/test/resources/certs/ca.pem
+++ /dev/null
@@ -1,22 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDqzCCApOgAwIBAgIUU/uMzfEhx21GXTOErSxGfoqt7qUwDQYJKoZIhvcNAQEL
-BQAwZTELMAkGA1UEBhMCQ04xEDAOBgNVBAgMB0JlaWppbmcxFTATBgNVBAcMDERl
-ZmF1bHQgQ2l0eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0ZDEPMA0GA1UE
-AwwGdGVzdENBMB4XDTIyMDQwMTA1NDEwMloXDTI3MDMzMTA1NDEwMlowZTELMAkG
-A1UEBhMCQ04xEDAOBgNVBAgMB0JlaWppbmcxFTATBgNVBAcMDERlZmF1bHQgQ2l0
-eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0ZDEPMA0GA1UEAwwGdGVzdENB
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyfqvVSox1n+5OBhCZC1C
-OKpLVKEIalvxOQ5ezDcAeqUXfNJloP+7YeAylpOEiuxVlCvy4UScxUb98isr8Q0W
-3hNIc1O/FNJfnOPEJoaJCGb0Uq0Mq4CaZonkN8/2nolPIC8yg2b2/mIa4ZJhH94x
-KNzSiKfBMEqv8f3iGi8RhHrcMZAMosbIWZ1fIRhciJDa1xvsSFZz/gOq/D+YC/ST
-MjgTm7q1HXugHDtTFNw0XO3iY7co13fZBJjGu8AqW1K8CFZEBoJlsTByvkkEYzf4
-OMjwKO6v9dc4spRY32v7Nt8zrTz4Hg4g2QrvJWacYfi3eHkoMTdJFMVGE6COo3dS
-VwIDAQABo1MwUTAdBgNVHQ4EFgQUbkVV4nft2UZ3SqcaZqftJFleKtIwHwYDVR0j
-BBgwFoAUbkVV4nft2UZ3SqcaZqftJFleKtIwDwYDVR0TAQH/BAUwAwEB/zANBgkq
-hkiG9w0BAQsFAAOCAQEAVnGMYzl1xX5UHSTpGwpu+twd0GntIw8eSBZkLHp2GJdG
-Xh1uozTq9UTwT7F/2zCcOFhCzTZi18cK0sHBb53yS6gK5HEarZvUyqFqmXNljJxi
-I2sw640O1rAygM6lpth5Kt7038lr5MgFccU0/2AKbQUyW7tUwupf4nQACh+1xQ3J
-m+jF050eJQTtApnRuUU+XF7ITYPANJPofa9rrfbP76LQk94De3PJP5Ijll+bgjs/
-7H1hm5PFaTF3zj86i77O7Ru63T8BajolosVVWcUSmtxa/zMRLNVSLncQd40bRl1i
-mxfKR5assb31p+U/c1NH5yLtburJcB3GPyMdsmeO0w==
------END CERTIFICATE-----
diff --git a/integration-tests/paho/src/test/resources/certs/server.key
b/integration-tests/paho/src/test/resources/certs/server.key
deleted file mode 100644
index 4dd056694e..0000000000
--- a/integration-tests/paho/src/test/resources/certs/server.key
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEAw/UF6GOP/oy8vlzPzgRdtaoLeYnGW+DGYnbdv3qY4LWpI+BE
-MqprVUC69jvgNzwgRXmudx1DM68u1HWvXR7yA2hHPJqshlPplqeRarX7i9QwrdTg
-FimEuw3BKeYjgqE9ddtYyDTcVF6mncRB6t4S9VrkuVBlIukt0lfZVs2JuaNKpRpc
-/mQ04DcdA8QrEXTPDzpirCTC61p2OsyldhmkbvS9UpV4ur6lkCS4KJ8VZLGdJeSk
-TGI7qOe6WJS859ukmgZjnaHuEcFzLcb0ywDubsO1q+dNaKyD8ju3GFJi2LnFKwlk
-N7w+b/zq8XmAIKvp6q2AvG/jpgmVmSSrKfwSsQIDAQABAoIBAQCr/4Fz/RAC6h0x
-Kd3sgsCOF/eCcn/9XUpEWvlAfKd7dXhE2TCDGDql1e9E+kFPuiLJWIjeXH0D/Jwq
-ODH4lpTukLUWaN1N+pFpfyOQerOUhGdF7TfTvBWY6fXGhQ5eNpDvxdwjvuI12+57
-RCxnrw0M9v8T+ZEMF4f0vM8z9a0Rls097a246yAn040SjMJm4+FKWLB2/KXvh/nl
-xOFk81TKl6f7/Sx+GKCOSLasdAwp5G/8uyzNH0i2q9yPkw/OR3QutntBphBq+RGH
-pEBwshQNOwAwKlkIYiYv+KEZiL3JAZdPiV5p9HOIKtaIjzGZOFJqv/fZJLJDJZHu
-FUwO8u1RAoGBAOVX6rW8Nnf3jh1ZqZu6Qr2bHT8p41k57m5airBqlqzFZesSwErO
-X2utli11j+thZSuFG+pH70MTH2f3Me4AhOVO2wrllzo8ygjymjTWYm0217g5dYWy
-NLqhRlD2FEKdXpfTIUYc52cbYEG4/q9L2MKBws/S6cKJZN5le8LsNrVHAoGBANq7
-s4JGEsgzEhx1IwdygqdZHkiE4plmT1i4ufogw1jLl4hN8ajF6pAHuF7ZiJDlQ+QR
-M+tFrC0XEg7c23M9LgrnXRMUbKvjTsN3OnTZCKZ/U7Gimnfu4j6Lwu13l3AZLjWv
-6cOx+B3bO31caa5rbsrCJNYTiFJQtn6Kuq5eR9RHAoGANbS/1u0LSE6lbgQYLsqQ
-ZHxVffweLD/fsOHtBmD/hdf4BPNwKlRnjfypZV3ZZQJ6wZU7M0LDKc7plNwTSiu+
-8z/jFYssPcwMd8nwCJ2HkRG9tHtoJPXVWTr5D26A0hSuGRms+hE8sy16/gkHQx+c
-0/e1GhvG9/Jat6XGNKBCM3MCgYB9jVRCqNpLFBWHRC1xLueUC3F4it5O0w0kjhQi
-YQAATgyS7rqR99jmB6hquU7MbO0FUmKM35cu4pk48sj8Yte05ozkUMr39yfUxvFE
-9PckKt3tjro/sV0oLa0cBZNlgu6lXm4+KD+VU6vYD12SApS7yai/QML1DONTy2nQ
-gMmWLQKBgA3Nb5bFkb6NPHtb7JhJLB2/veuhOGN3yEEs1GFjLF5sgR8Fq+R84tWM
-tGE9mqHGkhvrTlgAdY8DRZjcBg0VimUnXNCRn5wXmhcFs44zsprdr8+2Srcit6n4
-j/6HocZNXy46lBAFY7PYUYDfDSbyFRMfx3l34lV+tc9iM8HaWfev
------END RSA PRIVATE KEY-----
diff --git a/integration-tests/paho/src/test/resources/certs/server.pem
b/integration-tests/paho/src/test/resources/certs/server.pem
deleted file mode 100644
index ddad4073b4..0000000000
--- a/integration-tests/paho/src/test/resources/certs/server.pem
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDVDCCAjwCFD0B2OCkiJZYwb3trDFCX7mQ9wc1MA0GCSqGSIb3DQEBCwUAMGUx
-CzAJBgNVBAYTAkNOMRAwDgYDVQQIDAdCZWlqaW5nMRUwEwYDVQQHDAxEZWZhdWx0
-IENpdHkxHDAaBgNVBAoME0RlZmF1bHQgQ29tcGFueSBMdGQxDzANBgNVBAMMBnRl
-c3RDQTAeFw0yMjA0MDExMTQwMTBaFw0zMjAzMjkxMTQwMTBaMGgxCzAJBgNVBAYT
-AkNOMRAwDgYDVQQIDAdCZWlqaW5nMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAa
-BgNVBAoME0RlZmF1bHQgQ29tcGFueSBMdGQxEjAQBgNVBAMMCWxvY2FsaG9zdDCC
-ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMP1Behjj/6MvL5cz84EXbWq
-C3mJxlvgxmJ23b96mOC1qSPgRDKqa1VAuvY74Dc8IEV5rncdQzOvLtR1r10e8gNo
-RzyarIZT6ZankWq1+4vUMK3U4BYphLsNwSnmI4KhPXXbWMg03FRepp3EQereEvVa
-5LlQZSLpLdJX2VbNibmjSqUaXP5kNOA3HQPEKxF0zw86YqwkwutadjrMpXYZpG70
-vVKVeLq+pZAkuCifFWSxnSXkpExiO6jnuliUvOfbpJoGY52h7hHBcy3G9MsA7m7D
-tavnTWisg/I7txhSYti5xSsJZDe8Pm/86vF5gCCr6eqtgLxv46YJlZkkqyn8ErEC
-AwEAATANBgkqhkiG9w0BAQsFAAOCAQEAHFNHzAEW5x2A6dSoxopTR/SB1ffGnhfs
-6mkMBFppYYCYwJyWSgnWYsBB/m2xakyCpup1mPT6AAb8NiS2c0R9dEQsEtgwwc/j
-6KihqXSVBmux7pvMc6vLwGVYlHH7oAodS+ZPQUSs0wii++NzugRsHwwIdvGpUbVg
-Tc8VAiDHYG7z88l/m5zWsKMQp8FK1PyhTL0eDGK8eCfuWTfM2lf7ITuAjhKXLbPY
-/vHTp13/+IfuAREcl73iXm57epIgG715T6J3+jdxyqzKdkx2vkEo3dUWusu7WR73
-PsYsjXPTOI2/zUkkiVqwwIiVOLR9E332aOxeqZaqLBrYze9PHB1lPg==
------END CERTIFICATE-----
diff --git a/integration-tests/paho/src/test/resources/mosquitto.conf
b/integration-tests/paho/src/test/resources/mosquitto.conf
index 921dc8fc27..8cdd3ea091 100644
--- a/integration-tests/paho/src/test/resources/mosquitto.conf
+++ b/integration-tests/paho/src/test/resources/mosquitto.conf
@@ -6,9 +6,9 @@ protocol mqtt
listener 8883
protocol mqtt
-cafile /etc/mosquitto/certs/ca.pem
-certfile /etc/mosquitto/certs/server.pem
-keyfile /etc/mosquitto/certs/server.key
+cafile /etc/mosquitto/certs/paho-ca.crt
+certfile /etc/mosquitto/certs/paho.crt
+keyfile /etc/mosquitto/certs/paho.key
listener 9001
protocol websockets
diff --git a/integration-tests/platform-http-proxy-ssl/pom.xml
b/integration-tests/platform-http-proxy-ssl/pom.xml
index 8b1addae55..0e07848751 100644
--- a/integration-tests/platform-http-proxy-ssl/pom.xml
+++ b/integration-tests/platform-http-proxy-ssl/pom.xml
@@ -63,6 +63,11 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-integration-wiremock-support</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
diff --git
a/integration-tests/platform-http-proxy-ssl/src/main/java/org/apache/camel/quarkus/component/platform/http/proxy/ssl/it/Routes.java
b/integration-tests/platform-http-proxy-ssl/src/main/java/org/apache/camel/quarkus/component/platform/http/proxy/ssl/it/Routes.java
index 085e80ec5a..1af4f020a7 100644
---
a/integration-tests/platform-http-proxy-ssl/src/main/java/org/apache/camel/quarkus/component/platform/http/proxy/ssl/it/Routes.java
+++
b/integration-tests/platform-http-proxy-ssl/src/main/java/org/apache/camel/quarkus/component/platform/http/proxy/ssl/it/Routes.java
@@ -44,13 +44,13 @@ public class Routes extends RouteBuilder {
KeyManagersParameters keyManagersParameters = new
KeyManagersParameters();
KeyStoreParameters keyStore = new KeyStoreParameters();
keyStore.setPassword("changeit");
- keyStore.setResource("ssl/keystore.p12");
+ keyStore.setResource("certs/proxy-ssl-keystore.p12");
keyManagersParameters.setKeyPassword("changeit");
keyManagersParameters.setKeyStore(keyStore);
sslContextParameters.setKeyManagers(keyManagersParameters);
KeyStoreParameters truststoreParameters = new KeyStoreParameters();
- truststoreParameters.setResource("ssl/keystore.p12");
+ truststoreParameters.setResource("certs/proxy-ssl-keystore.p12");
truststoreParameters.setPassword("changeit");
TrustManagersParameters trustManagersParameters = new
TrustManagersParameters();
diff --git
a/integration-tests/platform-http-proxy-ssl/src/main/resources/application.properties
b/integration-tests/platform-http-proxy-ssl/src/main/resources/application.properties
index bdb7e92643..d71d52239c 100644
---
a/integration-tests/platform-http-proxy-ssl/src/main/resources/application.properties
+++
b/integration-tests/platform-http-proxy-ssl/src/main/resources/application.properties
@@ -16,4 +16,4 @@
## ---------------------------------------------------------------------------
-quarkus.native.resources.includes=ssl/keystore.p12
\ No newline at end of file
+quarkus.native.resources.includes=certs/proxy-ssl-keystore.p12
\ No newline at end of file
diff --git
a/integration-tests/platform-http-proxy-ssl/src/main/resources/ssl/keystore.p12
b/integration-tests/platform-http-proxy-ssl/src/main/resources/ssl/keystore.p12
deleted file mode 100644
index fadac3cb35..0000000000
Binary files
a/integration-tests/platform-http-proxy-ssl/src/main/resources/ssl/keystore.p12
and /dev/null differ
diff --git
a/integration-tests/platform-http-proxy-ssl/src/test/java/org.apache.camel.quarkus.component.platform.http.proxy.ssl.it/PlatformHttpSSLTestResource.java
b/integration-tests/platform-http-proxy-ssl/src/test/java/org.apache.camel.quarkus.component.platform.http.proxy.ssl.it/PlatformHttpSSLTestResource.java
index 27b0fa00b5..1430e3e553 100644
---
a/integration-tests/platform-http-proxy-ssl/src/test/java/org.apache.camel.quarkus.component.platform.http.proxy.ssl.it/PlatformHttpSSLTestResource.java
+++
b/integration-tests/platform-http-proxy-ssl/src/test/java/org.apache.camel.quarkus.component.platform.http.proxy.ssl.it/PlatformHttpSSLTestResource.java
@@ -50,7 +50,7 @@ public class PlatformHttpSSLTestResource extends
WireMockTestResourceLifecycleMa
// add an SSL port
config.dynamicHttpsPort();
// Either a path to a file or a resource on the classpath
- config.keystorePath("ssl/keystore.p12");
+ config.keystorePath("certs/proxy-ssl-keystore.p12");
// The password used to access the keystore. Defaults to "password" if
omitted
config.keystorePassword("changeit");
// The password used to access individual keys in the keystore.
Defaults to "password" if omitted
diff --git
a/integration-tests/platform-http-proxy-ssl/src/test/java/org.apache.camel.quarkus.component.platform.http.proxy.ssl.it/ProxySslTest.java
b/integration-tests/platform-http-proxy-ssl/src/test/java/org.apache.camel.quarkus.component.platform.http.proxy.ssl.it/ProxySslTest.java
index 8df99de9cf..3faa5e4b7a 100644
---
a/integration-tests/platform-http-proxy-ssl/src/test/java/org.apache.camel.quarkus.component.platform.http.proxy.ssl.it/ProxySslTest.java
+++
b/integration-tests/platform-http-proxy-ssl/src/test/java/org.apache.camel.quarkus.component.platform.http.proxy.ssl.it/ProxySslTest.java
@@ -20,11 +20,17 @@ import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Test;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.equalTo;
+@TestCertificates(certificates = {
+ @Certificate(name = "proxy-ssl", formats = {
+ Format.PKCS12 }, password = "changeit") })
@QuarkusTest
@QuarkusTestResource(PlatformHttpSSLTestResource.class)
public class ProxySslTest {
diff --git a/integration-tests/platform-http/README.adoc
b/integration-tests/platform-http/README.adoc
deleted file mode 100644
index 9ef992cbb2..0000000000
--- a/integration-tests/platform-http/README.adoc
+++ /dev/null
@@ -1,37 +0,0 @@
-# Generating server SSL certificates and trust store
-
-* The CA is self-signed:
-
-When prompted for certificate information, everything is default.
-```
-$ openssl genrsa -out ca.key 2048
-$ openssl req -x509 -new -key ca.key -nodes -out ca.pem -config ca-openssl.cnf
-days 3650 -extensions v3_req
-```
-
-* Server certificate issued by CA:
-
-```
-$ openssl genrsa -out server.key.rsa 2048
-$ openssl pkcs8 -topk8 -in server.key.rsa -out server.key -nocrypt
-$ rm server.key.rsa
-```
-
-When prompted for certificate information, everything is default except the
common name which is set to _localhost_ for simple testing.
-```
-$ openssl req -new -key server.key -out server.csr
-$ openssl x509 -req -in server.csr -CA ca.pem -CAkey ca.key -CAcreateserial
-out server.pem -outform PEM -days 5000
-```
-
-* Rename files
-
-```
-$ mv server.pem server-cert.pem
-$ mv server.key server-key.pem
-```
-
-* Generate the PKCS12 trust store
-
-When prompted for a password, the value is _s3cr3t_.
-```
-$ keytool -import -file server-cert.pem -alias server -keystore truststore.p12
-```
diff --git a/integration-tests/platform-http/ca-openssl.cnf
b/integration-tests/platform-http/ca-openssl.cnf
deleted file mode 100644
index e15866b281..0000000000
--- a/integration-tests/platform-http/ca-openssl.cnf
+++ /dev/null
@@ -1,18 +0,0 @@
-[req]
-distinguished_name = req_distinguished_name
-req_extensions = v3_req
-
-[req_distinguished_name]
-countryName = Country Name (2 letter code)
-countryName_default = AU
-stateOrProvinceName = State or Province Name (full name)
-stateOrProvinceName_default = Some-State
-organizationName = Organization Name (eg, company)
-organizationName_default = Internet Widgits Pty Ltd
-commonName = Common Name (eg, YOUR name)
-commonName_default = testca
-
-[v3_req]
-basicConstraints = CA:true
-keyUsage = critical, keyCertSign
-
diff --git a/integration-tests/platform-http/pom.xml
b/integration-tests/platform-http/pom.xml
index 5dcd28ff64..d001ed625f 100644
--- a/integration-tests/platform-http/pom.xml
+++ b/integration-tests/platform-http/pom.xml
@@ -72,6 +72,11 @@
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
diff --git
a/integration-tests/platform-http/src/main/resources/application.properties
b/integration-tests/platform-http/src/main/resources/application.properties
index 91b7768f8f..77e7fdcaa6 100644
--- a/integration-tests/platform-http/src/main/resources/application.properties
+++ b/integration-tests/platform-http/src/main/resources/application.properties
@@ -18,8 +18,8 @@
# Quarkus
#
quarkus.http.body.uploads-directory=target/uploads
-quarkus.http.ssl.certificate.files=server-cert.pem
-quarkus.http.ssl.certificate.key-files=server-key.pem
+quarkus.http.ssl.certificate.files=certs/platform-http.crt
+quarkus.http.ssl.certificate.key-files=certs/platform-http.key
quarkus.http.insecure-requests=disabled
quarkus.http.auth.basic=true
quarkus.http.auth.permission.default.paths=/platform-http/secure/basic
@@ -32,4 +32,4 @@ quarkus.security.users.embedded.roles.camel=Admin
# Required by the encoding() test
quarkus.native.add-all-charsets = true
-quarkus.native.resources.includes = *.pem
+quarkus.native.resources.includes = certs/*.crt,certs/*.key
diff --git a/integration-tests/platform-http/src/main/resources/server-cert.pem
b/integration-tests/platform-http/src/main/resources/server-cert.pem
deleted file mode 100644
index 4f6fb1f400..0000000000
--- a/integration-tests/platform-http/src/main/resources/server-cert.pem
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDMzCCAhsCFDB5CEpzuIQrToqmWRvTo5C5HpflMA0GCSqGSIb3DQEBCwUAMFYx
-CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl
-cm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnRlc3RjYTAeFw0yMzEwMzEx
-MjE0NThaFw0zNzA3MDkxMjE0NThaMFYxCzAJBgNVBAYTAlhYMRUwEwYDVQQHDAxE
-ZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQgQ29tcGFueSBMdGQxEjAQBgNV
-BAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL8q
-ewu3nW28mp4YZ0ZDM5vhkwiduCOkUcq6EwUFwetlp4plmdf/dm9CTLw/ue/Gkyz8
-h7MPgFkNc3l0wKfubuwt77ATMmzhvOIoTh1hNr+ZdfUGGtxXtU4yEQCYd8XvihbG
-DYERu7WnMoVMqxixhc02iSvlmSATpDUGQ5awVOLvvpKa4k0EoZtqvE5Xx7SkyJHo
-80OUK6gXM1Qe3naC2yX6vdYBq8vO9AB+19pC4Hla/9+RlRhcmhZsUvSxuZzqaQT0
-CETve10PFw9YvY2K1fchw0iiuvVP1TKcjOledrFO36kp8dXdh0oiAR2fonSyq9pS
-0FdBKlwzmd7XOirEjZ8CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAvrpKOKpz6YEw
-AqvXGMohjaTxEDW1CyeDCmAmjo4VqPR3nTBjslXbhJgwu8YK/qnUL2WEVXh0cUiI
-gMp4/6UxeH29wMSnK20hIocqjiR3suaV/pNJ4bsl9yNbImtsHZ9Y6kCizsSQ+Qt+
-b3OX1ycwPDcvR2DTxLKO6G0AShFXKvqdPNORGMap6n5kZgjGEwIdrnvWB9zF/uO+
-g/GYF9FCO78LOzfcACqJ09cuhve1KJreorMTTC5ps5YUOkE8K4xpmq7MM6W15vAK
-gPyb7sQMuD5n6ZlMHlJKF+EoXCid2Rc2llU96YO0tuDoJMjbVwUupI1emfqRPDvQ
-EfYwoInX3A==
------END CERTIFICATE-----
diff --git a/integration-tests/platform-http/src/main/resources/server-key.pem
b/integration-tests/platform-http/src/main/resources/server-key.pem
deleted file mode 100644
index e937e3a275..0000000000
--- a/integration-tests/platform-http/src/main/resources/server-key.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQC/KnsLt51tvJqe
-GGdGQzOb4ZMInbgjpFHKuhMFBcHrZaeKZZnX/3ZvQky8P7nvxpMs/IezD4BZDXN5
-dMCn7m7sLe+wEzJs4bziKE4dYTa/mXX1BhrcV7VOMhEAmHfF74oWxg2BEbu1pzKF
-TKsYsYXNNokr5ZkgE6Q1BkOWsFTi776SmuJNBKGbarxOV8e0pMiR6PNDlCuoFzNU
-Ht52gtsl+r3WAavLzvQAftfaQuB5Wv/fkZUYXJoWbFL0sbmc6mkE9AhE73tdDxcP
-WL2NitX3IcNIorr1T9UynIzpXnaxTt+pKfHV3YdKIgEdn6J0sqvaUtBXQSpcM5ne
-1zoqxI2fAgMBAAECggEBAIh5SFzGGgLUqcGCBICZy0dW1ARLrMDtN2M2Ugu834Mx
-EFnyTNFyVFf7ihK+n/x41GtCYZJI18U7oBuuaTe6NcAwzzPxkIdA5PrD8XhyBYbl
-hNuHHzf8+be4cIDvWFqbtwapH8zsHwkBM0UMxf0cBzzI2UbYY+gNfaZJMYlrmz5i
-0UJPPSWjT1IA1oq7mXGBAhgnNsJKxdZHgjoP3wYO/V1216PGdIS2Ufb+ZBOvN+xw
-aZctrSwzVQw/0a4E+gKhLT24a6cCu4sANMQ/+KF0SJYLXEgDWfXGVLRX6hl2oHIG
-mLXzzjxG8wIVvHW9aNVYQzE4Cxa0VDUOtq0cwi9cMSkCgYEA+3IH8awVrGEX6jTX
-Gd7V0MmybyhXqbC8egKxT2bHpnMJyL6Zi3moEK1z3LBcbYgavqpYTEJk3Fid+zKF
-DPSP+bynPqxR+x5E2wG5FlRzBpSuTBNHTAZlcb7gBJdHbbRfXUco7umaG1fxTrx+
-cLJ84+iapErpRWAStaJYpdbV+U0CgYEAwqDt/Y2h8Jjd1E6ZLKk0+iwbOsi7io5t
-0o+Z7XgKuO3FU4RbWTPqrLuCo6aA4bjuD2K9l2twM+L5sdlvqcPrDi8Sfa+rpFv8
-4vIUvaHkIWyNSjPSV6gHgt8wnwJkXwweeqBmOWGfcQo5ELwRhqmyXzyoQOQUuyLL
-990pCOIjDJsCgYEAm7FsAdTQRsCIEllNp5M3SeTaO8H7JfNtgQ8Rw1yc2w/4Svja
-EmbuDgWY7Fm3oYrZJJ5NtkqWMWodyGDrya3VSInr9P62dIu1jvZuKMl5v+VoV2rI
-huafAeNyyuTxMZiyRAu/6M90wOGfZWWJ1TZv5p8swfYwouhuLVGtGmMAczECgYEA
-us/vP7WHn8GLAvKicczELfDR/h2YbYkCft4ZOGdFm3WWNvDPIZMEiOG+pkf2YzK3
-RgtXwZR9cUBGvV/gn0mPP+EM1ZkdnjgxRsBoChDvQOnJwFR3bG27L/H84FNSdizS
-wI9fL2q1uLHAToDGLcSKkoFNWmPSRkFDGFmuvnkYfUsCgYEAyg8N8Ha3WDZqaj26
-TgOQlrl3rTp77qTWWG0nNnpGYLMu/T56ED2gjAdFFR/Kl589jWUbdZBwIHLKMb1y
-ctL00b+e2Rs7idV6gieQvRSkqy9VkhkKk3bU3pVmM1i0cVw1I7HDA0nh4Dv0fOiA
-S8QEYnxRrnyf3KmtpWxXTOwPWPI=
------END PRIVATE KEY-----
diff --git
a/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
b/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
index da6d35b9ec..8e0bc4ce44 100644
---
a/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
+++
b/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
@@ -23,8 +23,11 @@ import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import io.restassured.http.Method;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
import org.apache.camel.component.platform.http.PlatformHttpComponent;
import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpEngine;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -35,12 +38,15 @@ import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.notNullValue;
+@TestCertificates(certificates = {
+ @Certificate(name = "platform-http", formats = {
+ Format.PKCS12, Format.PEM }, password = "changeit") })
@QuarkusTest
class PlatformHttpTest {
@BeforeAll
public static void beforeAll() {
- RestAssured.trustStore("truststore.p12", "s3cr3t");
+ RestAssured.trustStore("certs/platform-http-truststore.p12",
"changeit");
}
@Test
diff --git a/integration-tests/platform-http/src/test/resources/truststore.p12
b/integration-tests/platform-http/src/test/resources/truststore.p12
deleted file mode 100644
index 2612d2c7be..0000000000
Binary files
a/integration-tests/platform-http/src/test/resources/truststore.p12 and
/dev/null differ
diff --git a/integration-tests/vertx-websocket/README.adoc
b/integration-tests/vertx-websocket/README.adoc
deleted file mode 100644
index a567f2ab50..0000000000
--- a/integration-tests/vertx-websocket/README.adoc
+++ /dev/null
@@ -1,15 +0,0 @@
-# Generating server SSL certificates and trust store
-
-1. Generate the certificate keypair
-
-When prompted for the 'Common Name', use localhost. The other prompts can be
skipped.
-
-```
-openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout
src/main/resources/server-key.pem -out src/main/resources/server-cert.pem
-```
-
-2. Generate the PKCS12 trust store
-
-```
-cat src/main/resources/server-key.pem src/main/resources/server-cert.pem |
openssl pkcs12 -export -out src/test/resources/truststore.p12 -passout
pass:s3cr3t
-```
diff --git a/integration-tests/vertx-websocket/pom.xml
b/integration-tests/vertx-websocket/pom.xml
index b8e6806d1e..408f6426b8 100644
--- a/integration-tests/vertx-websocket/pom.xml
+++ b/integration-tests/vertx-websocket/pom.xml
@@ -68,6 +68,11 @@
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+
<artifactId>camel-quarkus-integration-tests-support-certificate-generator</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
diff --git
a/integration-tests/vertx-websocket/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketResource.java
b/integration-tests/vertx-websocket/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketResource.java
index 5789689ecf..6ed424a619 100644
---
a/integration-tests/vertx-websocket/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketResource.java
+++
b/integration-tests/vertx-websocket/src/main/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketResource.java
@@ -141,7 +141,7 @@ public class VertxWebsocketResource {
@Named
public SSLContextParameters clientSSLContextParameters() {
KeyStoreParameters truststoreParameters = new KeyStoreParameters();
- truststoreParameters.setResource("/truststore.p12");
+
truststoreParameters.setResource("/certs/vertx-websocket-truststore.p12");
truststoreParameters.setPassword("changeit");
TrustManagersParameters trustManagersParameters = new
TrustManagersParameters();
diff --git
a/integration-tests/vertx-websocket/src/main/resources/application.properties
b/integration-tests/vertx-websocket/src/main/resources/application.properties
index 1f68f1a126..98bf8c5422 100644
---
a/integration-tests/vertx-websocket/src/main/resources/application.properties
+++
b/integration-tests/vertx-websocket/src/main/resources/application.properties
@@ -15,4 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-quarkus.native.resources.includes = *.pem,*.p12
+quarkus.native.resources.includes = certs/*.key,certs/*.crt
diff --git
a/integration-tests/vertx-websocket/src/main/resources/server-cert.pem
b/integration-tests/vertx-websocket/src/main/resources/server-cert.pem
deleted file mode 100644
index d5f9ce332b..0000000000
--- a/integration-tests/vertx-websocket/src/main/resources/server-cert.pem
+++ /dev/null
@@ -1,17 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICpDCCAYwCCQDF3E7qvZcoTjANBgkqhkiG9w0BAQsFADAUMRIwEAYDVQQDDAls
-b2NhbGhvc3QwHhcNMjEwOTE3MDkyODA4WhcNMzEwOTE1MDkyODA4WjAUMRIwEAYD
-VQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCi
-1+uq4ZcXTrY3j28k5ivqvSp9PyYhfCn6VZHB3Yk9+8Mn+QGMsUow9F4SPCTsHaOP
-p0SAVVBIiQxR5ucfrxPq+6TcZaccJcDTkiM2xsZeL5t1pRVz77RrUOPvDfTuPDSV
-MR2DVx/I/IZyKHYYL9JweUMHcCoAxWHWg74YiC9QLOiK55rO5Js9uz4FObf9oQee
-tjN4rVhBfwl8LSysnKdbRJzeLWajwlKRUwLZIUXDDyEG5kpEZI3P/E6IfaoOxLzE
-BnHa93ospIVSjgc24xgkUWkrki0LFQcooyu4kExJAO7uCjbqWjfOvoE7DOkjUslB
-bJQrzTGX8Ix+IR8Bg6XpAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFRpebKqbaET
-+2OcY4YGvun2e6zigc1Rd5fCHFt2CnOMAkJRrqrfRpLm71IvYp+lHGxk/fHW7Bi6
-vH66KC2sCIOjGIRF+/VL6Umwx3SPTVPilYHQ54bHSF5c4MV6pi3hPjFZyMfUY0RJ
-cgltmEMxIXtGU088jurqEsXHeBS5iOCNItVOjanUv9C2bl4dyMwwJDa7jkbHLII6
-VxrohPSdVSqVPRJisH6we7/txquEbtnW4YnrGFvNvhR4PJPJlyVfMQi904vxdxqq
-XSaaBHGDBomitbxp+NxMZ8yEDVlZeDPJb8nW0po7+i5ul2T0hGtCaCtJiwxZzKD2
-aPPjxB4aNfo=
------END CERTIFICATE-----
diff --git
a/integration-tests/vertx-websocket/src/main/resources/server-key.pem
b/integration-tests/vertx-websocket/src/main/resources/server-key.pem
deleted file mode 100644
index 35a0a96715..0000000000
--- a/integration-tests/vertx-websocket/src/main/resources/server-key.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCi1+uq4ZcXTrY3
-j28k5ivqvSp9PyYhfCn6VZHB3Yk9+8Mn+QGMsUow9F4SPCTsHaOPp0SAVVBIiQxR
-5ucfrxPq+6TcZaccJcDTkiM2xsZeL5t1pRVz77RrUOPvDfTuPDSVMR2DVx/I/IZy
-KHYYL9JweUMHcCoAxWHWg74YiC9QLOiK55rO5Js9uz4FObf9oQeetjN4rVhBfwl8
-LSysnKdbRJzeLWajwlKRUwLZIUXDDyEG5kpEZI3P/E6IfaoOxLzEBnHa93ospIVS
-jgc24xgkUWkrki0LFQcooyu4kExJAO7uCjbqWjfOvoE7DOkjUslBbJQrzTGX8Ix+
-IR8Bg6XpAgMBAAECggEBAIK+0DX8OH57MSw82qUKtRoc1Z+H80qRUXbv+z5na8i7
-ej5+2/KlagcSPPFxHsgBKBCv4P0VAoeqmZyswscan+hcMUrPxzN/UGnOfL1/LUfz
-+2KisC3MuNQtN0T5tL0O070xmRuZ+Sg7MIs510+mHdU2V04CjYbe86XzUs6JkUtR
-62l9ed5eVoYl7K6n/S0JyDzR/2wCdsLYvr+Y5r31qB4yYyVmKat3pTTb52EuseCl
-vZ4LggKz7jxDof/Kn/CyjkhU8dh6mv6opFsw7hUMO9f/OLfDMbFpBSm9eJCxrlm/
-qaD17gSpkSVehK5Hhnzc4jwlTgYHeQ89ga7+tfNCyAECgYEAzIYVuSJcA7j7Ye/3
-RFFoV2dDRu6YfXYKYkQP32gLpwWF3N1fKddGh45V73fa4SJN/5PeTlouK3F0OUNk
-Yr0F8AVkyEBMKDvvDKmz0aR9FHqsooGPLzucwMiEpWkGeX2hO+g1V2vRX1SHrdO2
-ywDlHqEHqKvlYBn6zwzqTN1mhwECgYEAy9RH2aqqEc/RFUylbLcmF6Rks7HdTOzS
-yA6wdiy/3zVxXjCpp++yMmTYjn9To//47Yx/7LSTBamiv21Kq8iKWnoku+ekxO6V
-pfIA6kiY6MgR7+Q+RW/xmXu8VZ6NYm5wffSWMLwYcRuLaof8SdnX3ODwDZLX3DOf
-UgvTvLrIxukCgYAEfzpBDNlbF5knaSBVtziFG3cmOx7NO2g1CuwSbHY9IOj1l0R9
-Zgdd+ao4DrmYU6nFYdn0fRUgzWjRzYKKjT9xLJ0vrgI+rDqwW5bhmC1L4vqixBiC
-4Fus/Xu1K18CEtoVuCBcILnEz9X/43TUd9uR1daWRdlQSKH0JYONVxznAQKBgQCV
-9vduJGzAciApBZ1oYU/7cQ5OT3y8zjk+y9/08nOw7Ace/7qzPl3jSeMy5GdLcFdb
-n1W3eBv7vJVrNiQMQ53Xd6pzPbky0z7zOxyFQyiNjDX2Q/205OnivPESJXdshkjp
-wvyFmr546YUnuilaxJZXgn/b3MBI2QpNOTptzxdNkQKBgDOOuUDz0uHFUFU3o+Mg
-xOb5Ilsa/h26HmtviA1H+GUXOyUPqnWpBcIEHJcgCdpSRQ13mfe6ItLKDdo8Ig8d
-udA76MX1brGYo6o5wzhgRf8slDXXaZ3/2TzZFJbQb8c5+oqDvLJxGxFCjYxw2Xnx
-eu9IttUytA5O9JVxngDTtJJE
------END PRIVATE KEY-----
diff --git
a/integration-tests/vertx-websocket/src/main/resources/truststore.p12
b/integration-tests/vertx-websocket/src/main/resources/truststore.p12
deleted file mode 100644
index 38ef0d9d37..0000000000
Binary files
a/integration-tests/vertx-websocket/src/main/resources/truststore.p12 and
/dev/null differ
diff --git
a/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketClientSslProvider.java
b/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketClientSslProvider.java
index c6021aa867..cdfc1994e9 100644
---
a/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketClientSslProvider.java
+++
b/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketClientSslProvider.java
@@ -35,7 +35,8 @@ public class VertxWebsocketClientSslProvider implements
WebsocketClientSslProvid
private static final SSLContext SSL_CONTEXT;
static {
- try (InputStream stream =
VertxWebsocketClientSslProvider.class.getResourceAsStream("/truststore.p12")) {
+ try (InputStream stream = VertxWebsocketClientSslProvider.class
+ .getResourceAsStream("/certs/vertx-websocket-truststore.p12"))
{
KeyStore keystore =
KeyStore.getInstance(KeyStore.getDefaultType());
keystore.load(stream, "changeit".toCharArray());
diff --git
a/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTest.java
b/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTest.java
index a7df544035..2053c2aba7 100644
---
a/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTest.java
+++
b/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTest.java
@@ -23,11 +23,17 @@ import io.quarkus.test.common.http.TestHTTPResource;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
import io.restassured.RestAssured;
+import me.escoffier.certs.Format;
+import me.escoffier.certs.junit5.Certificate;
+import org.apache.camel.quarkus.test.support.certificate.TestCertificates;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
+@TestCertificates(certificates = {
+ @Certificate(name = "vertx-websocket", formats = {
+ Format.PKCS12, Format.PEM }, password = "changeit") })
@TestProfile(VertxWebsocketSslTestProfile.class)
@QuarkusTest
public class VertxWebsocketSslTest {
@@ -36,7 +42,7 @@ public class VertxWebsocketSslTest {
@BeforeAll
public static void beforeAll() {
- RestAssured.trustStore("truststore.p12", "changeit");
+ RestAssured.trustStore("certs/vertx-websocket-truststore.p12",
"changeit");
}
@Test
diff --git
a/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTestProfile.java
b/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTestProfile.java
index 7bba8b76b0..ed7e2dbabc 100644
---
a/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTestProfile.java
+++
b/integration-tests/vertx-websocket/src/test/java/org/apache/camel/quarkus/component/vertx/websocket/it/VertxWebsocketSslTestProfile.java
@@ -25,8 +25,8 @@ public class VertxWebsocketSslTestProfile implements
QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of(
- "quarkus.http.ssl.certificate.files", "server-cert.pem",
- "quarkus.http.ssl.certificate.key-files", "server-key.pem",
+ "quarkus.http.ssl.certificate.files",
"certs/vertx-websocket.crt",
+ "quarkus.http.ssl.certificate.key-files",
"certs/vertx-websocket.key",
"quarkus.http.insecure-requests", "disabled");
}
}