Created
June 9, 2019 06:47
-
-
Save wes5510/192d2b2296cd273644c70d986edbdb38 to your computer and use it in GitHub Desktop.
Convert certification of let's encrypt to use in tomcat
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 | |
CERT_PATH="$1" | |
PRIVATE_PATH="$2" | |
CHAIN_PATH="$3" | |
FULLCHAIN_PATH="$4" | |
function checkArg() | |
{ | |
result=1 | |
if [ -z "$CERT_PATH" ] || [ -z "$PRIVATE_PATH" ] || [ -z "$CHAIN_PATH" ] || [ -z "$FULLCHAIN_PATH" ] | |
then | |
echo "Usage : $0 <cert.pem path> <private.pem path> <chain.pem path> <fullchain.path>" | |
return $result | |
fi | |
result=0 | |
return $result | |
} | |
if ! checkArg | |
then | |
exit 1 | |
fi | |
openssl pkcs12 -export -in $FULLCHAIN_PATH -inkey $PRIVATE_PATH -out keystore.p12 -name tomcat -CAfile $CHAIN_PATH -caname root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment