Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jan 8, 2026

Backport of #64966 to release/10.0

/cc @danegsta

Add support for automatically adding the dev cert to the Windows certificate store when trusted in WSL

When trusting the dev cert in WSL, also trust it in the Windows cert store.

Description

Updates Unix certificate trust behavior to check if running in WSL in interop mode based on well known file paths and environment variables. If so, attempt to use Windows powershell to add the dev cert to the Windows certificate store (under currentuser/root) as well with the friendly name "ASP.NET Core HTTPS development certificate (WSL)". This will allow Windows applications (particularly browsers) to trust local development traffic from .NET applications running in WSL.

Adding the certificate to only currentuser/root will allow the WSL certificate to be trusted, but Kestrel running on Windows won't attempt to use the certificate as it only looks for the dev cert in currentuser/my, so if the user wants to run dotnet apps on Windows they'd still need to run dotnet dev-certs https --trust on the Windows side to enable serving with the dev cert.

image

Fixes #45208

Customer Impact

On WSL when the dev cert is trusted, that trust only applies to WSL, but not to the Windows side. This leads to problems where services running on Windows or browsers don't trust the certificate from services running in WSL despite the user having run dev-certs https --trust. The only way to fix the issue has been to manually export and copy certificates and manually add them to the Windows cert store. This automates that process when it's detected that the user is running on WSL in interop mode so that they can run Windows executables from WSL and results in the cert being trusted in both WSL and Windows.

Regression?

  • Yes
  • No

[If yes, specify the version the behavior has regressed from]

Risk

  • High
  • Medium
  • Low

The new logic only applies when it's detected that we're on WSL and if it fails won't break other aspects of certificate trust on Linux systems.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

When servicing release/2.3

  • Make necessary changes in eng/PatchConfig.props

danegsta and others added 8 commits January 8, 2026 23:52
Co-authored-by: danegsta <50252651+danegsta@users.noreply.github.com>
…ecial characters

Co-authored-by: danegsta <50252651+danegsta@users.noreply.github.com>
…S script

Co-authored-by: danegsta <50252651+danegsta@users.noreply.github.com>
… already exists and ensure that only a single error message is shown if there's an exception
@wtgodbe wtgodbe added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Jan 9, 2026
@rbhanda rbhanda added this to the 10.0.3 milestone Jan 9, 2026
@wtgodbe wtgodbe merged commit 3512720 into release/10.0 Jan 10, 2026
28 checks passed
@wtgodbe wtgodbe deleted the backport/pr-64966-to-release/10.0 branch January 10, 2026 02:38
@dotnet-policy-service dotnet-policy-service bot modified the milestone: 10.0.3 Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants