From 9533ccf489792e499ac7f9e96ff6380e1a33d4f7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 18:33:00 +0000 Subject: [PATCH 1/3] Initial plan From f141d28fbe402b4b23d7554192796ddd40ff9264 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 18:35:09 +0000 Subject: [PATCH 2/3] Fix ASPNETCORE_HTTPS_PORTS values: use container port 443 instead of host port 8001 Co-authored-by: tdykstra <1569635+tdykstra@users.noreply.github.com> --- aspnetcore/security/docker-https.md | 8 ++++---- aspnetcore/security/includes/docker-https6.md | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/aspnetcore/security/docker-https.md b/aspnetcore/security/docker-https.md index 443ccd5e44c1..8764040e8b4e 100644 --- a/aspnetcore/security/docker-https.md +++ b/aspnetcore/security/docker-https.md @@ -4,7 +4,7 @@ author: wadepickett description: Learn how to host ASP.NET Core Images with Docker over HTTPS ms.author: wpickett ms.custom: mvc, sfi-ropc-nochange -ms.date: 09/07/2024 +ms.date: 03/03/2026 uid: security/docker-https --- # Hosting ASP.NET Core images with Docker over HTTPS @@ -61,7 +61,7 @@ Run the container image with ASP.NET Core configured for HTTPS in a command shel ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp ``` In the preceding code, replace `` with the password. The password must match the password used for the certificate. @@ -87,7 +87,7 @@ Run the container image with ASP.NET Core configured for HTTPS: ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp ``` In the preceding code, replace `` with the password. The password must match the password used for the certificate. @@ -107,7 +107,7 @@ Run the container image with ASP.NET Core configured for HTTPS: ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=c:\https\aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:C:\https\ --user ContainerAdministrator mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=c:\https\aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:C:\https\ --user ContainerAdministrator mcr.microsoft.com/dotnet/samples:aspnetapp ``` ***NOTE:*** `` is a placeholder for the Kestrel certificates default password. diff --git a/aspnetcore/security/includes/docker-https6.md b/aspnetcore/security/includes/docker-https6.md index fd5655a9f93f..94fc75219b84 100644 --- a/aspnetcore/security/includes/docker-https6.md +++ b/aspnetcore/security/includes/docker-https6.md @@ -48,7 +48,7 @@ Run the container image with ASP.NET Core configured for HTTPS in a command shel ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp ``` In the preceding code, replace `` with the password. The password must match the password used for the certificate. @@ -74,7 +74,7 @@ Run the container image with ASP.NET Core configured for HTTPS: ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v ${HOME}/.aspnet/https:/https/ mcr.microsoft.com/dotnet/samples:aspnetapp ``` In the preceding code, replace `` with the password. The password must match the password used for the certificate. @@ -94,7 +94,7 @@ Run the container image with ASP.NET Core configured for HTTPS: ```console docker pull mcr.microsoft.com/dotnet/samples:aspnetapp -docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=c:\https\aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:C:\https\ --user ContainerAdministrator mcr.microsoft.com/dotnet/samples:aspnetapp +docker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORTS=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password="" -e ASPNETCORE_Kestrel__Certificates__Default__Path=c:\https\aspnetapp.pfx -v %USERPROFILE%\.aspnet\https:C:\https\ --user ContainerAdministrator mcr.microsoft.com/dotnet/samples:aspnetapp ``` ***NOTE:*** `` is a placeholder for the Kestrel certificates default password. From 3aed21f34d8ae83db989ef015f0d8156fec6f537 Mon Sep 17 00:00:00 2001 From: Tom Dykstra Date: Wed, 4 Mar 2026 08:26:21 -0800 Subject: [PATCH 3/3] Update aspnetcore/security/docker-https.md Co-authored-by: Wade Pickett --- aspnetcore/security/docker-https.md | 1 + 1 file changed, 1 insertion(+) diff --git a/aspnetcore/security/docker-https.md b/aspnetcore/security/docker-https.md index 8764040e8b4e..c56906fcb40e 100644 --- a/aspnetcore/security/docker-https.md +++ b/aspnetcore/security/docker-https.md @@ -1,5 +1,6 @@ --- title: Hosting ASP.NET Core Images with Docker over HTTPS +ai-usage: ai-assisted author: wadepickett description: Learn how to host ASP.NET Core Images with Docker over HTTPS ms.author: wpickett