# How to install a local SSL certificate in macOS

> 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.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2020-08-02 | Topics: [Mac](https://flaviocopes.com/tags/mac/) | Canonical: https://flaviocopes.com/macos-install-ssl-local/

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](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_15.55.15.png)

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](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_15.55.23.png)

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](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_15.55.28.png)

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](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_15.56.18.png)

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

![Add Certificates dialog with Keychain dropdown changed to System instead of login](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_15.57.49.png)

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](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_15.58.00.png)

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

![Certificate details window showing localhost certificate with Trust section collapsed](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_15.58.05.png)

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](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_15.58.21.png)

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](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_15.58.38.png)

And it should now work across any browser you use.

![Safari browser showing secure localhost connection with lock icon in address bar](https://flaviocopes.com/images/macos-install-ssl-local/Screen_Shot_2020-07-31_at_16.19.54.png)
