Skip to content

Instantly share code, notes, and snippets.

@wes5510
Created June 9, 2019 06:47
Show Gist options
  • Save wes5510/192d2b2296cd273644c70d986edbdb38 to your computer and use it in GitHub Desktop.
Save wes5510/192d2b2296cd273644c70d986edbdb38 to your computer and use it in GitHub Desktop.
Convert certification of let's encrypt to use in tomcat
#!/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