Created
October 10, 2017 11:53
-
-
Save sergeimuller/3b3eb00f714a2f7f901e253908213770 to your computer and use it in GitHub Desktop.
Generate self signed cert for development
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
cat > openssl.cnf <<-EOF | |
[req] | |
distinguished_name = req_distinguished_name | |
x509_extensions = v3_req | |
prompt = no | |
[req_distinguished_name] | |
CN = *.dev | |
[v3_req] | |
keyUsage = keyEncipherment, dataEncipherment | |
extendedKeyUsage = serverAuth | |
subjectAltName = @alt_names | |
[alt_names] | |
DNS.1 = *.dev | |
DNS.2 = localhost | |
EOF | |
openssl req \ | |
-new \ | |
-newkey rsa:2048 \ | |
-sha1 \ | |
-days 3650 \ | |
-nodes \ | |
-x509 \ | |
-keyout ssl.key \ | |
-out ssl.crt \ | |
-config openssl.cnf | |
open -a Keychain\ Access ssl.crt | |
rm openssl.cnf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment