I've been running ng serve --ssl
on my current project for some time with no issue. The first time I ran it, angular automatically created a self-signed cert. My browser rejected it which is expected, so I exported it and imported it into my local trusted root certificates and turned on the Chrome flag chrome://flags/#allow-insecure-localhost
to allow me to use untrusted certs from localhost. So all was well for a while.
Today I'm running ng serve --ssl
and I'm getting the following error:
"Your connection is not private"
"NET::ERR_CERT_DATE_INVALID"
After inspecting the cert, sure enough, the cert has expired.
How do I get ng serve --ssl
to create a new cert and stop using the old expired one? I've already tried deleting the old expired one in my local cert management console but the same old expired cert is re-used whenever I run ng serve --ssl
Apparently the Angular CLI only creates a 1 month certificate when it autogenerates a cert. I downloaded and used Micrsoft's SysInternals ProcessMonitor to find the fix.
ng serve --ssl
if it's still runningnode_modules\webpack-dev-server\ssl\server.pem
ng serve --ssl
and you should have a new 30 day cert.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With