Created
January 16, 2020 14:30
-
-
Save y0n1/9b026222615d070c5fc9e7864eed2ab8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
SELF_SIGNED_CERTS_DIR="$PWD/.ssl" | |
[[ ! -d $SELF_SIGNED_CERTS_DIR ]] && mkdir $SELF_SIGNED_CERTS_DIR | |
rm -rf $SELF_SIGNED_CERTS_DIR/* | |
openssl req -newkey rsa:2048 -new -nodes \ | |
-keyout $SELF_SIGNED_CERTS_DIR/private-key.pem \ | |
-out $SELF_SIGNED_CERTS_DIR/csr.pem | |
openssl x509 -req -days 365 \ | |
-in $SELF_SIGNED_CERTS_DIR/csr.pem \ | |
-signkey $SELF_SIGNED_CERTS_DIR/private-key.pem \ | |
-out $SELF_SIGNED_CERTS_DIR/public-certificate.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment