Skip to content

Instantly share code, notes, and snippets.

@virtualLast
Last active August 14, 2018 12:00

Revisions

  1. Mike Last revised this gist Aug 14, 2018. 1 changed file with 2 additions and 21 deletions.
    23 changes: 2 additions & 21 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,2 @@
    #server.key can be named anything you like, remember to update the .conf files accordingly
    1 ) openssl genrsa -des3 -out server.key 2048
    #update localhost to whatever dynamic dns you have set up, or use IP:127.0.0.1
    2 ) openssl req \
    -newkey rsa:2048 \
    -x509 \
    -nodes \
    -keyout server.key \
    -new \
    -out server.crt \
    -subj /CN=localhost \
    -reqexts SAN \
    -extensions SAN \
    -config <(cat /System/Library/OpenSSL/openssl.cnf \
    <(printf '[SAN]\nsubjectAltName=DNS:localhost')) \
    -sha256 \
    -days 3650
    3 ) cp server.key server.tmp
    4 ) openssl rsa -in server.tmp -out server.key
    5 ) cp server.crt /Applications/MAMP/conf/apache
    6 ) cp server.key /Applications/MAMP/conf/apache
    cd /usr/local/etc/httpd
    openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
  2. Mike Last created this gist Oct 16, 2017.
    21 changes: 21 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #server.key can be named anything you like, remember to update the .conf files accordingly
    1 ) openssl genrsa -des3 -out server.key 2048
    #update localhost to whatever dynamic dns you have set up, or use IP:127.0.0.1
    2 ) openssl req \
    -newkey rsa:2048 \
    -x509 \
    -nodes \
    -keyout server.key \
    -new \
    -out server.crt \
    -subj /CN=localhost \
    -reqexts SAN \
    -extensions SAN \
    -config <(cat /System/Library/OpenSSL/openssl.cnf \
    <(printf '[SAN]\nsubjectAltName=DNS:localhost')) \
    -sha256 \
    -days 3650
    3 ) cp server.key server.tmp
    4 ) openssl rsa -in server.tmp -out server.key
    5 ) cp server.crt /Applications/MAMP/conf/apache
    6 ) cp server.key /Applications/MAMP/conf/apache