How to completely disable “Your connection is not private” warning in Chrome for local HTTPS development?

I’m developing a website locally (WSL) and using the Windows hosts file to map the real production domain (e.g., example.com) to 127.0.0.1.

My local site uses https:// links everywhere because the production version uses SSL.

To view the live (production) site, I comment out the relevant hosts entry:

#127.0.0.1    example.com

However, when I uncomment it and try to work on the local site, Chrome constantly blocks me with the following certificate error:

Your connection is not private
Attackers might be trying to steal your information from example.com (for example, passwords, messages, or credit cards). Learn more about this warning
NET::ERR_CERT_AUTHORITY_INVALID

I do not want to create or install local certificates — I’d prefer Chrome to just allow the connection without complaints.

I’ve already tried:

  • Launching Chrome with the --ignore-certificate-errors flag: "C:Program FilesGoogleChromeApplicationchrome.exe" --ignore-certificate-errors (didn’t work)
  • Disabling Safe Browsing via chrome://settings/security by selecting “No protection (not recommended)”.

Nothing helped — Chrome keeps showing the certificate warning.
Is there a reliable way to suppress or bypass this error in Chrome for development purposes?