在使用MAMP进行本地测试时,我创建了一个用于测试某些https URL的虚拟SSL证书。我引用了这个演练:https://gist.github.com/jfloff/5138826。以下步骤与创建SSL证书相关:
$ 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
# 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
但自创建以来,我在http和https网址之间交替时遇到了意外问题。
我尝试了什么:
但这两种方法都没有解决问题。我该怎么做才能撤消这个?