Skip to content

Instantly share code, notes, and snippets.

@RishiKulshreshtha
Created August 16, 2017 18:00
Show Gist options
  • Save RishiKulshreshtha/3e88fe938bdb4f9b0909e17cbaec9137 to your computer and use it in GitHub Desktop.
Save RishiKulshreshtha/3e88fe938bdb4f9b0909e17cbaec9137 to your computer and use it in GitHub Desktop.
HTTPS on MAMP
openssl req -new -nodes -newkey rsa:2048 -subj '/C=IN/ST=MH/L=Pune/O=Organisation/OU=Development/emailAddress=address@example.com/CN=localhost/subjectAltName=DNS.1=192.168.0.1/' -keyout server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
cp server.key server.tmp
openssl rsa -in server.tmp -out server.key
cp server.crt /Applications/MAMP/conf/apache
cp server.key /Applications/MAMP/conf/apache
//
openssl req -new -sha256 \
-key server.key \
-subj "/C=IN/ST=MH/L=Pune/O=Organisation/OU=Development/emailAddress=address@example.com/CN=localhost" \
-reqexts SAN \
-config <(cat /etc/ssl/openssl.cnf \
<(printf "\n[SAN]\nsubjectAltName=DNS:localhost,DNS:192.168.0.1")) \
-out server.csr
openssl req -new -sha256 -key server.key -subj "/C=IN/ST=MH/L=Pune/O=Organisation/OU=Development/emailAddress=address@example.com" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:localhost,DNS:192.168.0.1")) -out server.csr
//
openssl req -new -sha256 -key server.key -subj "/C=IN/ST=MH/L=Pune/O=Organisation/OU=Development/emailAddress=address@example.com" -out server.csr -extfile v3.ext
openssl req -x509 -newkey rsa:2048 -out MyCompanyCA.cer -outform PEM -keyout MyCompanyCA.pvk -days 10000 -verbose -config MyCompanyCA.cnf -nodes -sha256 -subj "/CN=Globant"
openssl req -newkey rsa:2048 -keyout MyCompanyLocalhost.pvk -out MyCompanyLocalhost.req -subj /CN=localhost -sha256 -nodes
openssl x509 -req -CA MyCompanyCA.cer -CAkey MyCompanyCA.pvk -in MyCompanyLocalhost.req -out MyCompanyLocalhost.cer -days 10000 -extfile MyCompanyLocalhost.ext -sha256 -set_serial 0x1111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment