HTTPS Error using IIS Express
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
I run a vanilla asp.net core web app by checking the checkbox for configuring HTTPS. The certificate appears untrusted in chrome and edge.
### Expected Behavior
_No response_
### Steps To Reproduce
There are remediation steps proposed by this guy, and this is a good example of what should work.
https://github.com/steffbeckers/iis-express-ssl-reset-test/tree/main
I've updated the TFM on my local machine to NET6.
### Exceptions (if any)
_No response_
### .NET Version
7.0.400
### Anything else?
I was linked to [this issue](https://github.com/dotnet/aspnetcore/issues/16892) and this [SO post](https://stackoverflow.com/questions/20036984/how-do-i-restore-a-missing-iis-express-ssl-certificate/20048613#20048613) from your [documentation](https://learn.microsoft.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-7.0&tabs=visual-studio%2Clinux-ubuntu#troubleshoot-certificate-problems-such-as-certificate-not-trusted), but nothing has worked for me.
I have also performed the steps [outlined in this blog post](https://steffbeckers.eu/blog/iis-express-localhost-ssl-certificate-reset) with no success.
This means that I have
1. Repaired IIS 10.0 Express in control panel
2. Repaired visual studio installation from VS installer
3. Run every PS script in that blog post above
You can see that the port is bound and this cert exists in my store

Some screenshots of certificate manager
User/Personal store

User/TrustedRootCA

Computer/CertStore

**No sign of localhost in Computer/TrustedRootCA**
I can confirm that I clicked "OK" in the dialog for me to trust it.
Some extra context which I think is irrelevant but adding here regardless
Visual Studio Version 17.7.2
dotnet --info
.NET SDK:
Version: 7.0.400
Commit: 73bf45718d
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.400\
Host:
Version: 7.0.10
Architecture: x64
Commit: a6dbb800a4
.NET SDKs installed:
6.0.408 [C:\Program Files\dotnet\sdk]
7.0.400 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Contributor guide
Assessment
This issue has not been assessed yet.