Safari/Mac uses wrong certificate - how to fix?

I made the mistake to name the Local website the same as my remote website. Now when I access the remote website, the certificate of the local website is used (incorrect). Which Mac system settings should I change?

Using Mac/High Sierra and latest version of Local (5.10.0).

  1. Installed Local and added a local site with the same name as a remote site
  2. Accessed the remote site in a web browser and got a warning that the site is insecure (Safari and Chrome)
  3. Upon checking the certificate, it turns out that the remote website is associated with the certificate that Local has assigned to the local website, which is the wrong certificate
  4. I’d like to fix this but can’t find where something needs to be changed.

I’ve tried deleting the certificates generated by Local in Keychain Access, deleting Local and the local website, re-installing Local and local website with a different name, changing local domain name in Local, clearing browser caches. Nevertheless it looks like some setting on the Mac system keeps pointing my remote domain to a local domain.

The most recent error log entry:

2021/03/06 09:10:59 [error] 223#0: *24 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 127.0.0.1, server: opslagboxamp2.local, request: “GET / HTTP/2.0”, upstream: “http://127.0.0.1:10004/”, host: “opslagboxen.com
<<<<

What you basically did is to say to your Mac yoursite.com is located on your computer. It has nothing to do with the certificate. To fix this:

  1. On your Mac, click on the desktop with your mouse so you see the Finder menu selected upstairs.
  2. Click on Go (tab in the menu) and Go to Folder inside this menu.
  3. Write in the path: /etc/hosts and click enter.
  4. Open this file with VScode (editor) and delete the entries for yoursite.com

::1 yoursite.com
127.0.0.1 yoursite.com
::1 www.yoursite.com
127.0.0.1 www.yoursite.com

  1. Save the file (it will ask you to save as sudo) enter your admin password.
  2. Enjoy being able to access your live website again.

That fixed it - thank you very much!
Never would gotten so far myself.

No problem. Glad I was able to help.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.