diff --git a/samples/run-aspnetcore-https-development.md b/samples/run-aspnetcore-https-development.md index 286f26f4c0..fe15d191d3 100644 --- a/samples/run-aspnetcore-https-development.md +++ b/samples/run-aspnetcore-https-development.md @@ -46,8 +46,12 @@ Use the following instructions, for your operating system configuration. The com ![Developer Tools -- Delete cookie](https://user-images.githubusercontent.com/2608468/40246148-875fee5a-5a7c-11e8-9728-7da89a491014.png) +Further, if you're loading SSL certificates and trimming assemblies as part of the publish, you'll also need to update the project file for the sample. Please see details for how you can [support SSL certificates](https://docs.microsoft.com/en-us/dotnet/core/deploying/trim-self-contained#support-for-ssl-certificates). + ### Windows using Linux containers +The following example uses PowerShell. + Navigate to sample: ```console @@ -57,7 +61,7 @@ cd samples\aspnetapp Generate cert and configure local machine: ```console -dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword +dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\aspnetapp.pfx -p crypticpassword dotnet dev-certs https --trust ``` @@ -84,7 +88,7 @@ docker build --pull -t aspnetapp . Run the container image with ASP.NET Core configured for HTTPS: ```console -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -v %APPDATA%\microsoft\UserSecrets\:/root/.microsoft/usersecrets -v %USERPROFILE%\.aspnet\https:/root/.aspnet/https/ aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -v $env:APPDATA\microsoft\UserSecrets\:/root/.microsoft/usersecrets -v $env:USERPROFILE\.aspnet\https:/root/.aspnet/https/ aspnetapp ``` After the application starts, navigate to `http://localhost:8000` in your web browser. @@ -168,6 +172,8 @@ After the application starts, navigate to `http://localhost:8000` in your web br ### Windows using Windows containers +The following example uses PowerShell. + Navigate to sample: ```console @@ -177,7 +183,7 @@ cd samples\aspnetapp Generate cert and configure local machine: ```console -dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p crypticpassword +dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\aspnetapp.pfx -p crypticpassword dotnet dev-certs https --trust ``` @@ -204,7 +210,9 @@ docker build --pull -t aspnetapp . Run the container image with ASP.NET Core configured for HTTPS. ```console -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -v %APPDATA%\microsoft\UserSecrets\:C:\Users\ContainerUser\AppData\Roaming\microsoft\UserSecrets -v %USERPROFILE%\.aspnet\https:C:\Users\ContainerUser\AppData\Roaming\ASP.NET\Https aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -v $env:APPDATA\microsoft\UserSecrets\:C:\Users\ContainerUser\AppData\Roaming\microsoft\UserSecrets -v $env:USERPROFILE\.aspnet\https:C:\Users\ContainerUser\AppData\Roaming\ASP.NET\Https aspnetapp ``` After the application starts, navigate to `http://localhost:8000` in your web browser. + +> In the case of using https, be sure to check the certificate you're using is trusted on the host. You can start with navigating to https://localhost:8001 in the browser. If you're looking to test https with a domain name (e.g. https://contoso.com:8001), the certificate would also need the appropiate Subject Alternative Name included, and the DNS settings on the host would need to be updated. In the case of using the generated dev certificate, the trusted certificate will be issued from localhost and will not have the SAN added.