Created
February 8, 2022 04:18
-
-
Save weinong/fabb28969c34fccc8fa08b417c37f824 to your computer and use it in GitHub Desktop.
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
| openssl req \ | |
| -newkey rsa:2048 \ | |
| -x509 \ | |
| -nodes \ | |
| -keyout server.key \ | |
| -new \ | |
| -out server.crt \ | |
| -subj /CN=example.com \ | |
| -reqexts SAN \ | |
| -extensions SAN \ | |
| -config <(cat /System/Library/OpenSSL/openssl.cnf \ | |
| <(printf '[SAN]\nsubjectAltName=DNS:example.com')) \ | |
| -sha256 \ | |
| -days 3650 | |
| # drag the server.crt to Keychain Access > System (keychains) > Certificate | |
| # right click the certificate "Get Info" > Expand "Trust" > set SSL and x509 Basic Policy to "Always Trust" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment