Skip to content

Instantly share code, notes, and snippets.

@richlander
Created June 14, 2018 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save richlander/ad39598e8e8c2d250f95247019617373 to your computer and use it in GitHub Desktop.
Save richlander/ad39598e8e8c2d250f95247019617373 to your computer and use it in GitHub Desktop.
ASP.NET Core dotnet and docker commands for HTTPS
dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword
dotnet dev-certs https --trust
docker pull microsoft/dotnet-samples:aspnetapp
docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="crypticpassword" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ microsoft/dotnet-samples:aspnetapp
Copy link

ghost commented Nov 12, 2019

What if I have a custom certificate which is not located inside %USERPROFILE%.aspnet\https\aspnetapp.pfx?

Say I have a self-signed certificate stored at %USERPROFILE%\certificates\dummy.pfx. What would I pass to ASPNETCORE_Kestrel__Certificates__Default__Path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment