Skip to content

Instantly share code, notes, and snippets.

@weinong
Created February 8, 2022 04:18
Show Gist options
  • Select an option

  • Save weinong/fabb28969c34fccc8fa08b417c37f824 to your computer and use it in GitHub Desktop.

Select an option

Save weinong/fabb28969c34fccc8fa08b417c37f824 to your computer and use it in GitHub Desktop.
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