-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable Mail & Kafka test certificates to be regenerated for the docke…
…r host name or ip address
- Loading branch information
1 parent
7eef399
commit 067d3cc
Showing
12 changed files
with
273 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,17 @@ | ||
== Camel Quarkus Kafka SASL SSL integration tests | ||
|
||
To regenerate the SSL key and trust stores, do the following: | ||
To regenerate the SSL certificates and trust stores for use with local host testing run the following script: | ||
|
||
[source,shell] | ||
---- | ||
cd src/test/resources/config | ||
rm -f *.p12 | ||
export SECRET=kafkas3cret | ||
export JKS_FILE=kafka-keystore.jks | ||
export JKS_TRUST_FILE=kafka-truststore.jks | ||
export CERT_FILE=localhost.crt | ||
export PKCS_FILE=kafka-keystore.p12 | ||
export PKCS_TRUST_FILE=kafka-truststore.p12 | ||
export PEM_FILE_CERT=kafka-cert.pem | ||
export PEM_FILE_KEY=kafka-key.pem | ||
./regenerate-certificates.sh | ||
---- | ||
|
||
keytool -genkey -alias kafka-test-store -keyalg RSA -keystore ${JKS_FILE} -keysize 2048 -validity 3650 -dname CN=localhost -keypass ${SECRET} -storepass ${SECRET} | ||
keytool -export -alias kafka-test-store -file ${CERT_FILE} -keystore ${JKS_FILE} -keypass ${SECRET} -storepass ${SECRET} | ||
keytool -importkeystore -srckeystore ${JKS_FILE} -srcstorepass ${SECRET} -destkeystore ${PKCS_FILE} -deststoretype PKCS12 -deststorepass ${SECRET} | ||
keytool -keystore ${JKS_TRUST_FILE} -import -file ${CERT_FILE} -keypass ${SECRET} -storepass ${SECRET} -noprompt | ||
keytool -importkeystore -srckeystore ${JKS_TRUST_FILE} -srcstorepass ${SECRET} -destkeystore ${PKCS_TRUST_FILE} -deststoretype PKCS12 -deststorepass ${SECRET} | ||
If required, you can override the default certificate CN and SAN configuration by passing them as script arguments: | ||
|
||
rm -f *.crt *.jks | ||
[source,shell] | ||
---- | ||
cd src/test/resources/config | ||
./regenerate-certificates.sh "other-dns-or-ip" "DNS:another-dns,IP:192.168.1.150" | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
integration-tests/kafka-sasl-ssl/src/test/resources/config/generate-certificates.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/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. | ||
# | ||
|
||
|
||
rm -f *.p12 | ||
|
||
export CN=${1:-localhost} | ||
export SUBJECT_ALT_NAMES=${2:-"DNS:localhost,IP:127.0.0.1"} | ||
export SECRET=kafkas3cret | ||
export JKS_FILE=kafka-keystore.jks | ||
export JKS_TRUST_FILE=kafka-truststore.jks | ||
export CERT_FILE=localhost.crt | ||
export PKCS_FILE=kafka-keystore.p12 | ||
export PKCS_TRUST_FILE=kafka-truststore.p12 | ||
export PEM_FILE_CERT=kafka-cert.pem | ||
export PEM_FILE_KEY=kafka-key.pem | ||
|
||
keytool -genkey -alias kafka-test-store -keyalg RSA -keystore ${JKS_FILE} -keysize 2048 -validity 3650 -ext "san=${SUBJECT_ALT_NAMES}" -dname CN=${CN} -keypass ${SECRET} -storepass ${SECRET} | ||
keytool -export -alias kafka-test-store -file ${CERT_FILE} -keystore ${JKS_FILE} -keypass ${SECRET} -storepass ${SECRET} | ||
keytool -importkeystore -srckeystore ${JKS_FILE} -srcstorepass ${SECRET} -destkeystore ${PKCS_FILE} -deststoretype PKCS12 -deststorepass ${SECRET} | ||
keytool -keystore ${JKS_TRUST_FILE} -import -file ${CERT_FILE} -keypass ${SECRET} -storepass ${SECRET} -noprompt | ||
keytool -importkeystore -srckeystore ${JKS_TRUST_FILE} -srcstorepass ${SECRET} -destkeystore ${PKCS_TRUST_FILE} -deststoretype PKCS12 -deststorepass ${SECRET} | ||
|
||
rm -f *.crt *.jks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,17 @@ | ||
== Camel Quarkus Kafka SSL integration tests | ||
|
||
To regenerate the SSL key and trust stores, do the following: | ||
To regenerate the SSL certificates and trust stores for use with local host testing run the following script: | ||
|
||
[source,shell] | ||
---- | ||
cd src/test/resources/config | ||
rm -f *.p12 | ||
export SECRET=kafkas3cret | ||
export JKS_FILE=kafka-keystore.jks | ||
export JKS_TRUST_FILE=kafka-truststore.jks | ||
export CERT_FILE=localhost.crt | ||
export PKCS_FILE=kafka-keystore.p12 | ||
export PKCS_TRUST_FILE=kafka-truststore.p12 | ||
export PEM_FILE_CERT=kafka-cert.pem | ||
export PEM_FILE_KEY=kafka-key.pem | ||
./regenerate-certificates.sh | ||
---- | ||
|
||
keytool -genkey -alias kafka-test-store -keyalg RSA -keystore ${JKS_FILE} -keysize 2048 -validity 3650 -dname CN=localhost -keypass ${SECRET} -storepass ${SECRET} | ||
keytool -export -alias kafka-test-store -file ${CERT_FILE} -keystore ${JKS_FILE} -keypass ${SECRET} -storepass ${SECRET} | ||
keytool -importkeystore -srckeystore ${JKS_FILE} -srcstorepass ${SECRET} -destkeystore ${PKCS_FILE} -deststoretype PKCS12 -deststorepass ${SECRET} | ||
keytool -keystore ${JKS_TRUST_FILE} -import -file ${CERT_FILE} -keypass ${SECRET} -storepass ${SECRET} -noprompt | ||
keytool -importkeystore -srckeystore ${JKS_TRUST_FILE} -srcstorepass ${SECRET} -destkeystore ${PKCS_TRUST_FILE} -deststoretype PKCS12 -deststorepass ${SECRET} | ||
If required, you can override the default certificate CN and SAN configuration by passing them as script arguments: | ||
|
||
rm -f *.crt *.jks | ||
[source,shell] | ||
---- | ||
cd src/test/resources/config | ||
./regenerate-certificates.sh "other-dns-or-ip" "DNS:another-dns,IP:192.168.1.150" | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
integration-tests/kafka-ssl/src/test/resources/config/generate-certificates.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/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. | ||
# | ||
|
||
|
||
rm -f *.p12 | ||
|
||
export CN=${1:-localhost} | ||
export SUBJECT_ALT_NAMES=${2:-"DNS:localhost,IP:127.0.0.1"} | ||
export SECRET=kafkas3cret | ||
export JKS_FILE=kafka-keystore.jks | ||
export JKS_TRUST_FILE=kafka-truststore.jks | ||
export CERT_FILE=localhost.crt | ||
export PKCS_FILE=kafka-keystore.p12 | ||
export PKCS_TRUST_FILE=kafka-truststore.p12 | ||
export PEM_FILE_CERT=kafka-cert.pem | ||
export PEM_FILE_KEY=kafka-key.pem | ||
|
||
keytool -genkey -alias kafka-test-store -keyalg RSA -keystore ${JKS_FILE} -keysize 2048 -validity 3650 -ext "san=${SUBJECT_ALT_NAMES}" -dname CN=${CN} -keypass ${SECRET} -storepass ${SECRET} | ||
keytool -export -alias kafka-test-store -file ${CERT_FILE} -keystore ${JKS_FILE} -keypass ${SECRET} -storepass ${SECRET} | ||
keytool -importkeystore -srckeystore ${JKS_FILE} -srcstorepass ${SECRET} -destkeystore ${PKCS_FILE} -deststoretype PKCS12 -deststorepass ${SECRET} | ||
keytool -keystore ${JKS_TRUST_FILE} -import -file ${CERT_FILE} -keypass ${SECRET} -storepass ${SECRET} -noprompt | ||
keytool -importkeystore -srckeystore ${JKS_TRUST_FILE} -srcstorepass ${SECRET} -destkeystore ${PKCS_TRUST_FILE} -deststoretype PKCS12 -deststorepass ${SECRET} | ||
|
||
rm -f *.crt *.jks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
== 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" | ||
---- |
Oops, something went wrong.