Last active
May 25, 2017 09:56
-
-
Save tobystokes/22824647af13d2808e65d0fd3997d9b7 to your computer and use it in GitHub Desktop.
Generate self signed cert for local development, without Chrome SAN warnings
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
# replace [local.dev] with your domain | |
# You will still get ERR_CERT_COMMON_NAME_INVALID - but that can be solved by using the standard add to keychain and trust method | |
openssl req \ | |
-newkey rsa:2048 \ | |
-x509 \ | |
-nodes \ | |
-keyout server.key \ | |
-new \ | |
-out server.crt \ | |
-subj /CN=[local.dev] \ | |
-reqexts SAN \ | |
-extensions SAN \ | |
-config <(cat /System/Library/OpenSSL/openssl.cnf \ | |
<(printf '[SAN]\nsubjectAltName=DNS:[local.dev]')) \ | |
-sha256 \ | |
-days 3650 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment