Advertisement
Intermediate ASP.NET Core, HTTPS, Certificates & Transport Security

What is a self-signed certificate, and why is the ASP.NET Core development HTTPS certificate (dotnet dev-certs) not suitable for production use?

Short answer

A self-signed certificate is one not issued by a trusted Certificate Authority (CA), meaning browsers and other clients don't inherently trust it and will show security warnings unless the certificate is manually trusted on each machine -- the dotnet dev-certs tool generates…

Save ASP.NET Core mock interview
Advertisement
AModel answer
A self-signed certificate is one not issued by a trusted Certificate Authority (CA), meaning browsers and other clients don't inherently trust it and will show security warnings unless the certificate is manually trusted on each machine -- the dotnet dev-certs tool generates exactly this kind of certificate for local development convenience (installed into the local trust store so your own machine's browser doesn't warn), but it must never be used in production since external users' browsers/devices have no way to trust it, and it's fundamentally not designed for that purpose (short-lived, tied to the local machine).
# Generate and trust a local development HTTPS certificate
dotnet dev-certs https --trust

# For production, obtain a certificate from a real, trusted CA instead
# (e.g. via Let's Encrypt, DigiCert, or your organization's internal CA)
Real-world example
A developer testing locally uses dotnet dev-certs https --trust to get a working HTTPS localhost environment without browser warnings, but the production deployment uses a properly CA-issued certificate obtained through the company's certificate management process, never the dev certificate.
Likely follow-ups
  • What happens if a dev certificate is accidentally used in a staging or production environment?
  • How does certificate trust actually work at the browser/OS level (the chain of trust)?
Related topics