Skip to content

Instantly share code, notes, and snippets.

@esthervillars
Last active June 19, 2019 04:06
Show Gist options
  • Save esthervillars/a71d2791fd69d1de639c71f81f675bf4 to your computer and use it in GitHub Desktop.
Save esthervillars/a71d2791fd69d1de639c71f81f675bf4 to your computer and use it in GitHub Desktop.
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