Created
May 4, 2017 18:21
-
-
Save alexsasharegan/8535747c92fea60f72234b0f82c857dc to your computer and use it in GitHub Desktop.
Self sign an ssl certificate for development on localhost with Chrome >= 58
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 bash | |
| openssl req \ | |
| -newkey rsa:2048 \ | |
| -x509 \ | |
| -nodes \ | |
| -keyout ~/.localhost-ssl/<cert-name>.key \ | |
| -new \ | |
| -out ~/.localhost-ssl/<cert-name>.crt \ | |
| -subj /CN=<server-name> \ | |
| -reqexts SAN \ | |
| -extensions SAN \ | |
| -config <(cat /System/Library/OpenSSL/openssl.cnf \ | |
| <(printf '[SAN]\nsubjectAltName=DNS:<server-name>')) \ | |
| -sha256 \ | |
| -days 3650 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment