Aspnetcore.docs: How to trust HTTPS cert from WSL Ubuntu on Windows?

Created on 20 Jun 2018  Â·  5Comments  Â·  Source: dotnet/AspNetCore.Docs

I'm using Windows Subsystem for Linux (Ubuntu) to host my ASP.NET Core web app. It has generated its own HTTPS self-signed cert. How do I configure my Windows cert store to trust that cert so that my Windows browser will navigate to it and trust it?
Note I've tried the command above, but it only trusts the Windows-generated cert. I need Windows to trust the Linux cert.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P1 P2 Source - Docs.ms

All 5 comments

This helped out. I followed the instructions to export my Windows-generated cert:

dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword

Then in my WSL window I ran:

ASPNETCORE_Kestrel__Certificates__Default__Password="crypticpassword" ASPNETCORE_Kestrel__Certificates__Default__Path=/mnt/c/Users/andarno/.aspnet/https/aspnetapp.pfx dotnet watch run

That effectively set the environment variables so that linux would use the Windows generated-and-trusted cert. Then my Windows browser was happy to access it. :)

@guardrex where is the right place to surface this info? I'm thinking in another doc, but link to it here.

@scottaddie isn't this related to #3310 ?

@Rick-Anderson I think so. Is there anything we want to change in the get started page? If not, I'll address it at the linked issue.

Make sure this page has a link showing how to set it up a cert for Ubuntu

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StevenTCramer picture StevenTCramer  Â·  3Comments

Rick-Anderson picture Rick-Anderson  Â·  3Comments

AnthonyMastrean picture AnthonyMastrean  Â·  3Comments

sonichanxiao picture sonichanxiao  Â·  3Comments

wgutierrezr picture wgutierrezr  Â·  3Comments