Skip to content

Instantly share code, notes, and snippets.

@thomaswitt
Created April 8, 2014 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomaswitt/10205855 to your computer and use it in GitHub Desktop.
Save thomaswitt/10205855 to your computer and use it in GitHub Desktop.
# upload-cert www_myserver_com.crt aws_profile_name SSL123_SecondaryCA.crt SSL123_PrimaryCA.crt
function upload-cert() {
NAME=`echo "$1" | cut -d'.' -f1`
END=`openssl x509 -in $NAME.crt -noout -enddate | cut -f2 -d= | while read x; do date -j -f '%b %d %T %Y %Z' "$x" '+%Y-%m-%d'; done`
cat $3 $4 $5 >certchain.pem
aws --profile $2 iam upload-server-certificate --server-certificate-name ${NAME}-${END} \
--certificate-body file://$NAME.crt --private-key file://$NAME.key.rsa --certificate-chain file://certchain.pem
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment