Create SSL certificate for localhost HTTPS using mkcert as trusted certificate authority

Install mkcert; Create local certificate authority; Create certificates for your localhost application.

Mac

Install mkcert using Homebrew

brew install mkcert
brew install nss

Create local certificate authority (CA)

mkcert -install

Create certificates for your localhost application

mkcert localhost localhost 127.0.0.1 ::1Code language: CSS (css)

Troubleshooting

Problem: Certificate is invalid. When clicking on the insecure warning next to the address bar to inspect the certificate it shows that it was issued by you computer with mkcert.

Solution: You may have missed the step to make mkcert a local CA.

Leave a Reply

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