Created
July 22, 2020 10:25
-
-
Save rhovelz/19f19bbc20930df0027723ee521c7575 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#Author Corshine | |
#Github: github.com/rdvcorshine/ | |
#!/bin/bash | |
PASSWORD=test1234 | |
VALIDITY=365 | |
keytool -keystore kafka.server.keystore.jks -alias localhost -validity $VALIDITY -genkey | |
openssl req -new -x509 -keyout ca-key -out ca-cert -days $VALIDITY | |
keytool -keystore kafka.server.truststore.jks -alias CARoot -import -file ca-cert | |
keytool -keystore kafka.client.truststore.jks -alias CARoot -import -file ca-cert | |
keytool -keystore kafka.server.keystore.jks -alias localhost -certreq -file cert-file | |
openssl x509 -req -CA ca-cert -CAkey ca-key -in cert-file -out cert-signed -days $VALIDITY -CAcreateserial -passin pass:$PASSWORD | |
keytool -keystore kafka.server.keystore.jks -alias CARoot -import -file ca-cert | |
keytool -keystore kafka.server.keystore.jks -alias localhost -import -file cert-signed | |
keytool -keystore kafka.client.keystore.jks -alias localhost -validity $VALIDITY -genkey | |
keytool -keystore kafka.client.keystore.jks -alias localhost -certreq -file cert-file | |
openssl x509 -req -CA ca-cert -CAkey ca-key -in cert-file -out cert-signed -days $VALIDITY -CAcreateserial -passin pass:$PASSWORD | |
keytool -keystore kafka.client.keystore.jks -alias CARoot -import -file ca-cert | |
keytool -keystore kafka.client.keystore.jks -alias localhost -import -file cert-signed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment