Mar 19
2018
2018
HTTPS on MAMP localhost Trobles Resolved
HTTPS on LOCALHOST (MAMP) with VIRTUALHOST and New Browsers Release
SOLUTION:
- https://gist.github.com/jfloff/5138826
- and follow these comments: https://gist.github.com/jfloff/5138826#gistcomment-2131538 (I added for each dev domain a DNS name) https://gist.github.com/jfloff/5138826#gistcomment-2145381 and https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI like this guy: https://gist.github.com/jfloff/5138826#gistcomment-2214818
https://support.mozilla.org/en-US/questions/1204477#answer-1076049 here I found the solution in order to add exeption for self-signed certificate
conclusions:
- here the whole story
- at the end of the this article I found the answer at my dilemma "so what use instead of .dev?". And is .localhost or .test
- and so I can keep use all the browsers I need
SAMPLE CODE
$ cd ~
# generate a private key (will request a password twice)
$ openssl genrsa -des3 -out server.key 1024
# generate certificate signing request (same password as above)
$ openssl req -new -key server.key -out server.csr
# Answer the questions
Country Name (2 letter code) [AU]: CA
State or Province Name (full name) [Some-State]: Quebec
Locality Name (eg, city) []: Montreal
Organization Name (eg, company) [Internet Widgits Pty Ltd]: Your Company
Organizational Unit Name (eg, section) []: Development
Common Name (eg, YOUR name) []: localhost
Email Address []: your_email@domain.com
A challenge password []: # leave this empty
An optional company name []: # leave this empty
# Added from comment
# change "your-domain" as your needs
$ openssl req -new -sha256 -key server.key -subj "/C=US/ST=CA/O=OK Mine/CN=localhost" -reqexts SAN -config <(cat /System/Library/OpenSSL/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:your-domain.test,DNS:your-domain2.test,DNS:your-domain3.test")) -out server.csr
# generate the certificate
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
# remove the password from the server key
$ cp server.key server.tmp
$ openssl rsa -in server.tmp -out server.key
# Move the certificate into your MAMP apache configuration folder
$ cp server.crt /Applications/MAMP/conf/apache
$ cp server.key /Applications/MAMP/conf/apache