Last active
June 19, 2019 04:06
-
-
Save esthervillars/a71d2791fd69d1de639c71f81f675bf4 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
sudo openssl req \ | |
-newkey rsa:2048 \ | |
-x509 \ | |
-nodes \ | |
-keyout certificates/localhost.key \ | |
-new \ | |
-out certificates/localhost.crt \ | |
-subj /CN=Hostname \ | |
-reqexts SAN \ | |
-extensions SAN \ | |
-config <(cat /etc/ssl/openssl.cnf \ | |
<(printf '[SAN]\nsubjectAltName=DNS:hostname,IP:192.168.0.1')) \ | |
-sha256 \ | |
-days 3650 | |
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain certificates/localhost.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment