Skip to content
FLAVIO COPES
flaviocopes.com
2026

How to install a local SSL certificate in macOS

By Flavio Copes

Learn how to install and trust a local SSL certificate in macOS so your browser stops warning on HTTPS, by adding it to the System keychain in Chrome.

~~~

You’ve written an app that should use HTTPS, but it’s not working: you’re getting a warning when you try to access it using HTTPS, even though you created a local certificate.

Chrome privacy error page showing Your connection is not private with localhost:3008 in address bar

That’s because by default the browser does not trust local certificates.

We need to install it!

I assume you use Chrome in this section

Click the “Not Secure” box near the address bar, and a little panel should show up:

Chrome security panel showing Certificate and Cookies options after clicking Not Secure

Click the Certificate item in the box, and you should see another panel show up, with the certificate details:

Certificate details dialog showing localhost self-signed root certificate with certificate icon visible

Now drag the certificate icon from there to the desktop, or any other folder you want. Literally drag and drop using the mouse.

Once you do so, find the file in the Finder, and double-click it.

You should see a prompt to install it:

Add Certificates dialog asking to add localhost.cer certificate with Keychain dropdown set to login

Where you see the Keychain: option, instead of login, choose System:

Add Certificates dialog with Keychain dropdown changed to System instead of login

Press Add, now you should see the certificate in the System keychain, listed as localhost:

Keychain Access app showing localhost certificate in System keychain list

Now double-click that, and this window should show up:

Certificate details window showing localhost certificate with Trust section collapsed

Click the arrow near Trust, and you should see this window, make sure you change “When using this certificate” to “Always Trust”.

Trust settings expanded showing When using this certificate set to Always Trust

That’s it! Now close the Keychain app (cmd-Q) and try reloading your Chrome tab, it should work!

Chrome showing secure localhost:3008 with React app running successfully

And it should now work across any browser you use.

Safari browser showing secure localhost connection with lock icon in address bar

Tagged: Mac · All topics
~~~

Related posts about mac: