What is the correct way to create a self-signed certificate for use locally with netlify dev (mac)


I have a site locally that I need to use with HTTPS, I have created a self-signed certificate and added the certFile and keyFile values to my netlify.toml file but I’m still getting a security warning “Your connection is not private” when I try to access the site. The error is “NET::ERR_CERT_AUTHORITY_INVALID”. Could anybody detail the steps to create a certificate so I no longer get this error?


This is nothing to do with Netlify (the intention of these forums is solving issue related to building and deploying on Netlify.)

A quick search for self sign certificate for local development yields numerous results including this article from Let’s Encrypt.

Hi @dig, thanks for your response. This is directly related to using the Netlify CLI to run a secure site locally.

From the (currently) open issue feature(command-dev): auto generate certificates when https is used · Issue #2136 · netlify/cli · GitHub I take the quote

To run netlify dev in HTTPS mode, a user will only need to configure https = true in their netlify.toml dev block (also a flag netlify dev --secure)

You’ll find this linked from the length issue Feature request: support secure HTTPS local dev environnement · Issue #455 · netlify/cli · GitHub which is worth you reading.