Last active
September 18, 2019 10:43
-
-
Save daggerhart/a416d27fa699fbb4108ba09c7dd82b4b to your computer and use it in GitHub Desktop.
Simple script to generate a certificate used for local development on OSX
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 | |
read -p 'Domain: ' DOMAIN | |
openssl req \ | |
-newkey rsa:2048 \ | |
-x509 \ | |
-nodes \ | |
-keyout "$DOMAIN".key \ | |
-new \ | |
-out $DOMAIN.crt \ | |
-subj /CN="$DOMAIN" \ | |
-reqexts SAN \ | |
-extensions SAN \ | |
-config <(cat /System/Library/OpenSSL/openssl.cnf \ | |
<(printf "[SAN]\nsubjectAltName=DNS:$DOMAIN")) \ | |
-sha256 \ | |
-days 720 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to:
./_genCert.sh