-
-
Save tague/55563bbe15167d8709d6aa70657f5690 to your computer and use it in GitHub Desktop.
Convert Redis Enterprise Cloud credentials to key/truststore
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
#!/bin/bash | |
echo -n "store password: " | |
read -s storepass | |
echo "" | |
## Create Truststore from PEM file | |
keytool -import -noprompt -trustcacerts -alias redislabs-ca -file redislabs_ca.pem -keystore redislabs_truststore.p12 -storepass $storepass -storetype PKCS12 | |
keytool -list -keystore redislabs_truststore.p12 -storepass $storepass | |
## Create Keystore from certificate and private key | |
openssl pkcs12 -export -in redislabs_user.crt -inkey redislabs_user_private.key -out redisclient.p12 -passout pass:$storepass | |
keytool -importkeystore -noprompt -srckeystore redisclient.p12 -srcstoretype PKCS12 -srcstorepass $storepass -destkeystore redisclient_keystore.p12 -deststoretype PKCS12 -storepass $storepass | |
rm redisclient.p12 | |
keytool -list -keystore redislabs_truststore.p12 -storepass $storepass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment