Use SSL with MAMP PRO 4

大兔子大兔子 提交于 2019-12-04 13:31:15

问题


Since I've updated to chrome 63, my sites in localhost are redirected to https, so I decided to use SSL with MAMP PRO but I can't make it work, chrome says Your connection is not private.

In the SSL panel of MAMP, I generated the certificate and set its path for the key and certificate, however I don't know what I should do for "Certificate chain file (Apache only)"


回答1:


I hit the same issue recently and found a solution that works for me on macOS.

As you've already highlighted, this issue started with a Chrome update which is forcing SSL on localhost *.dev URLs.

To get around it you need to add the certificate to your keychain and override the trust setting:

  1. After creating the self-signed certificate through MAMP Pro, open a Finder window and navigate to the directory where you just created the certificate.
  2. Open Keychain Access. Unlock it for editing with your admin password if necessary.
  3. Click Certificates in the bottom left.
  4. Drag the .crt file from Finder into the Keychain Access window. You should now see the certificate appear here.
  5. Right-click the certificate (in Keychain Access) and select Get Info.
  6. Expand the Trust section.
  7. Next to Secure Sockets Layer (SSL) select Always Trust from the dropdown.
  8. Close the certificate info window. You'll be asked if you want to save the changes and authorise with admin password.
  9. Return to Chrome. Reload the page. Get back to work.



回答2:


I'm having the same problem and creating a self-signed certificate doesn't work either. See https://jasonyingling.me/local-dev-development-site-stopped-working/, which explains that Chrome ^63 will force https for any site ending in .dev and that it requires a trusted certificate, which seems impossible to set up for localhost. There will likely be a better solution that evolves for MAMP users but the short-term fix is to use Firefox or reconfigure your local dev environment and local sites to use .local or .test, etc.



来源:https://stackoverflow.com/questions/47838052/use-ssl-with-mamp-pro-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!