Last active
September 13, 2020 03:57
-
-
Save junkor-1011/1c4f03608369b6870e4d4583da894e75 to your computer and use it in GitHub Desktop.
autogenerate openssl key & crt
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
| #!/usr/bin/env sh | |
| # get this script's path | |
| SCRIPT_DIR=$(cd $(dirname $0); pwd) | |
| cd $SCRIPT_DIR | |
| # generate key & crt | |
| openssl req -batch -new -x509 -newkey rsa:4096 -days 3650 -sha256 -nodes \ | |
| -subj /CN=example.com \ | |
| -addext "subjectAltName=DNS:example.com,DNS:www.example.com" \ | |
| -keyout ./server.key \ | |
| -out ./server.crt | |
| # chmod | |
| chmod 400 ./server.key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment