Local’s SSL “Trust” button is BROKEN on macOS. Here’s why, and here’s the fix. [A LocalWP Addon].

Click Trust next to your site’s SSL certificate in Local. Enter your admin password like a good citizen. Watch it report success. Open https://mysite.local and… “Your connection is not private”. Click Trust again. Password again. Success again. Warning again.

Insanity, as the saying goes, is clicking the same button twice and expecting different results. Or something like that.

The Problem

On modern macOS, Local’s Trust button doesn’t work. Well it does, but not for you. It shows the password prompt, appears to succeed, and changes absolutely nothing; browsers keep screaming about your .local certificate forever. And because it looks like it worked, you naturally assume the problem is elsewhere; your browser cache, your cert, your karma. It isn’t. It’s the button.

So it works, but it doesn’t…

Here’s the fun part. Local runs security add-trusted-cert through a background sudo helper (@vscode/sudo-prompt). And in that non-interactive context, modern macOS quietly refuses to write the trust settings. Hooray for security.

And the kicker; run the VERY SAME command yourself in a Terminal, with a plain old interactive sudo, and it works flawlessly. macOS doesn’t hate the command. It hates the messenger.

The Solution

Trust SSL – macOS Fix takes over the trustSiteCert IPC channel behind the Trust button. Click Trust and instead of the broken background flow, the addon;

  1. writes a small trust-ssl.sh script into the site’s root folder,
  2. opens it in a Terminal window, where you authenticate with sudo yourself (the one context where macOS actually accepts the trust settings),
  3. polls the System keychain, and once the certificate is really trusted, tells Local’s UI so the button flips to “Trusted” — and cleans up the script after itself.

Everything else (certificate generation, the trust-status check) is left to Local. The addon fixes the one step that’s broken and touches nothing else. On Windows and Linux it does exactly nothing, as it should.

One thing to keep in mind, though;

The addon inspects Local’s internals — the trustSiteCert IPC channel and the certificate location under ~/Library/Application Support/Local/run/router/nginx/certs/. Verified against Local 10.1.1 on macOS. If a future Local release changes those internals (or, dare I dream, fixes the button upstream); check the repo first, I might have an update waiting for you.

It should come as no surprise; you don’t need this on Linux or Windows. This is a MacOS security thing.

Get it

Source on GitHub: rmpel/Local-Trust-Ssl-MacOS. Be sure to read the notes.

Install from source;
git clone git@github.com:rmpel/Local-Trust-Ssl-MacOS.git
cd Local-Trust-Ssl-MacOS
./scripts/install.sh # symlinks into Local's addons dir + npm install

Restart Local to make it visible in the Installed addons list, toggle on as usual.

Install from a dist file; grab the latest .tgz from the dist folder, or build it with ./scripts/build.sh, and use the “Install from disk” feature in LocalWP.

Author: Remon Pel

WebDeveloper though not WebDesigner

One thought on “Local’s SSL “Trust” button is BROKEN on macOS. Here’s why, and here’s the fix. [A LocalWP Addon].”

  1. That’s a really frustrating experience – I’ve seen similar issues pop up with SSL certificates and Local before. It seems like there might be some underlying configuration problems.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Confidental Infomation
stop spam mail