Simple HTTPS ASP.NET Core application with custom self-signed certificate.
- See certificate configuration in appsettings.Development.json
- File localhost.pfx must be installed in Windows first. Double click it, then follow the procedure (password is
demo
).
In case you're curious, the certificate localhost.pfx was generated with these two Openssl for Windows commands.
openssl req -x509 -sha256 -nodes -days 3650 -newkey rsa:2048 -keyout localhost.key -out localhost.crt -subj "/C=IT/ST=Provincia/L=Comune/O=Organization/OU=IT Department/CN=localhost/" -addext "subjectAltName=DNS:localhost"
openssl pkcs12 -export -out localhost.pfx -inkey localhost.key -in localhost.crt
You might also want to check this helpful article by humankode.