Skip to content

Commit

Permalink
Rename certificates to make more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Nov 8, 2023
1 parent b05a98d commit a783b8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ services:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,SSL://localhost:19092
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_DELETE_TOPIC_ENABLE: "true"
KAFKA_SSL_KEYSTORE_FILENAME: kafka.keystore.jks
KAFKA_SSL_KEYSTORE_FILENAME: broker.keystore.jks
KAFKA_SSL_KEYSTORE_CREDENTIALS: pwd.txt
KAFKA_SSL_KEY_CREDENTIALS: pwd.txt
KAFKA_SSL_TRUSTSTORE_FILENAME: kafka.truststore.jks
KAFKA_SSL_TRUSTSTORE_FILENAME: broker.truststore.jks
KAFKA_SSL_TRUSTSTORE_CREDENTIALS: pwd.txt
KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: " "
KAFKA_SSL_CLIENT_AUTH: required
Expand Down
7 changes: 3 additions & 4 deletions .devcontainer/kafka_secrets/create_secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ rm -f *.crt *.csr *.key *.srl *.jks *.p12
pw=testpw
echo $pw > pwd.txt

# generate CA key
echo "Generate a CA key..."
openssl req -new -x509 -keyout ca.key -out ca.crt -days 9999 \
-subj '/CN=ca.test.ghga.dev/OU=TEST/O=GHGA' \
-passin pass:$pw -passout pass:$pw

for component in kafka client
for component in broker client
do
echo "Create keystore for Kafka $component..."
# create keystore
keytool -genkey -noprompt -alias $component \
-dname "CN=localhost, OU=TEST, O=GHGA" \
-keystore $component.keystore.jks \
Expand Down Expand Up @@ -69,4 +68,4 @@ keytool -importkeystore -srckeystore client.keystore.jks -srcalias client \
openssl pkcs12 -in client.keystore.p12 -nocerts -out client.key \
-passin pass:$pw -passout pass:$pw

rm -f kafka.crt kafka.key ca.key *.csr *.p12 *.srl
rm -f broker.crt broker.key ca.key *.csr *.p12 *.srl

0 comments on commit a783b8a

Please sign in to comment.