Issue accessing wp-admin: "can't provide a secure connection"

What issue or error are you experiencing?

I get an error when I try to access admin login screen: “This site can’t provide a secure connection. mysite.dev sent an invalid response”.


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

I enter https://mysite.dev/wp-admin into address bar and hit enter. Instead of going to login screen, the url changes to https://mysite.dev:10064/wp-admin and the page shows this error “This site can’t provide a secure connection. mysite.dev sent an invalid response”.

Next, if I remove the :10064 from the url and hit enter it DOES load the login page.

I’ve used Local for many years and this just started happening on all of my sites.


System Details

  • Local Version:
    The latest version
  • Operating System (OS) and OS version:
    MacOS 14.2.1

Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)
local-logs.zip (305.2 KB)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

URL changes to using port when accessing wp-admin - #24 by oumouchaibo I tried this but it did not resolve my issue.

I noticed you’re on the latest release and you said it was working fine before. Could you try downgrading and see if that helps?

This is interesting. My mind goes to one of a few things:

  1. Did you recently change from localhost to “Site Domains” router mode? It might be that the localhost port wasn’t updated correctly.
  2. Is the url correct within the DB?
  3. Is the url cached somehow in the browser?

To determine that the url is correct within the DB, you can click “Site shell” and in the terminal that opens, run this command:

wp option get siteurl

What value does that return?

To see if the url is cached in the browser, you can try clearing the cache for that url and see if it continues to redirect.

@ben.turner thanks for troubleshooting help. I don’t know what “Site Domains” router mode is. :man_shrugging:

The DB value is http://law.dev…is it supposed to be https?

I cleared URL cache and it didn’t resolve issue.

Hey @clayteller

If you click on Preferences and then Advanced you should see a Router Mode option in there with a drop down for Localhost or Site Domains. More about these here:

You’ll want the value in the DB to be the same as what you are entering in the Browser address bar. I think you mentioned using HTTPS in the original topic, so you can update that value in the DB by opening a site shell and running:

wp search-replace 'http://law.dev' 'https://law.dev'

You might need to clear the browser cache, but I think that should help prevent the odd redirect you’re seeing the browser.

My Router Mode is set to Site domains and as far as I know I’ve never touched that setting. Thanks for the explanation @Nick-B.

@ben.turner thanks for answering https DB question. I just updated the DB value to https and cleared my browser cache and restarted Local site but the issue is still there. :face_with_diagonal_mouth:

When I create a new site I always have to Trust the site SSL and then I have to go to Mac keychain and Always trust the URL in that program. After that my sites have always worked using https without this current issue.

I looked back at my older Local sites that have always worked without this issue and they all use the http value in the database instead of https. I understand that the value is supposed to be https but somehow Local sites have worked flawlessly in the past despite the value in the DB being http.

I provided my Local logs. I looked at them but I don’t know how to “read” them. Is there any helpful troubleshooting info in those?

Are other people experiencing this issue or is there something uniquely wrong with my system?

This is the current, expected behavior under MacOS, but we have it in our backlog to explore ways to improve how a site is trusted so that you don’t always need to do those manual steps.

Local doesn’t automatically do a search and replace to update from http to https within the DB which is likely why the older sites are still using the regular protocol. Strictly speaking, using HTTPS isn’t totally required under a dev environment, mostly because using HTTPS is a way to guarantee you are interacting with the correct server. For the live, production sites, you definitely want to ensure that HTTPS is active and correctly configured for the production environment.

You probably don’t need to update those older sites unless you really want to.

Going back to solving the original issue – it might makes sense to try and re-import the site to see if that helps. To do this:

  1. Right-click on the site in Local and select “Export” which will give you a zip archive of the site.
  2. Drag-and-drop the site onto Local and import it as a second site with a slightly different name, path, and domain

Can you give that a try and let us know if that fixes the issue on this new site?

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