-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Description
Related EPIC #41990
Visual Studio's container and WSL tools today automatically export the ASP.NET Core HTTPS dev cert from the host machine and import it into the application container or WSL instance as part of the launch experience. As the dev cert is the same as used by the Windows host, browsers running on the host continue to trust it despite it being served from the container or WSL and thus no warnings or errors are shown. This results in a smooth default experience when using ASP.NET Core with HTTPS in Visual Studio with containers or WSL.
Outside of Visual Studio however is a different story. To remove the errors and warnings associated with the dev cert requires manually exporting the certificate (via dotnet dev-certs https) on the host OS and then configuring it within the context of where the app is running (i.e. container image or WSL). In the case of WSL the dotnet dev-certs-https tool could be updated to support configuring the dev-cert for WSL by compiling a self-contained, single exe, trimmed app to perform operations on the WSL distro (rough prototype).
Update dotnet dev-certs https commands to support WSL via dotnet dev-certs https --wsl (create, trust, export, etc.).