Created
April 8, 2014 22:59
-
-
Save thomaswitt/10205855 to your computer and use it in GitHub Desktop.
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
# 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