Created
November 21, 2017 13:23
-
-
Save hanoii/e9b4d4e70d1fa44964300e2cfd9a57c4 to your computer and use it in GitHub Desktop.
Bash script to create a self-signed wildcard certificate with SAN extension
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
#!/bin/bash | |
openssl req \ | |
-newkey rsa:2048 \ | |
-x509 \ | |
-nodes \ | |
-keyout localhost.key \ | |
-new \ | |
-out localhost.crt \ | |
-subj /CN=dev.localhost \ | |
-reqexts SAN \ | |
-extensions SAN \ | |
-config <(cat /System/Library/OpenSSL/openssl.cnf \ | |
<(printf '[SAN]\nsubjectAltName=DNS:dev.localhost,DNS:*.dev.localhost')) \ | |
-sha256 \ | |
-days 3650 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment