Skip to content

wslc trust Windows host Trusted Store certs#40785

Open
yao-msft wants to merge 10 commits into
masterfrom
user/yaosun/trusthostcerts
Open

wslc trust Windows host Trusted Store certs#40785
yao-msft wants to merge 10 commits into
masterfrom
user/yaosun/trusthostcerts

Conversation

@yao-msft

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Enumerate Windows Trusted Root Store certs, export as a cert bundle and put in the vm /etc/ssl/certs

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Manually validated a custom cert signed registry fails when doing wslc push (unknown authority). After putting the cert in Trusted Root store, wslc push (with fresh session) succeeds. Also added test to validate the same behavior.

Copilot AI review requested due to automatic review settings June 12, 2026 02:10
@yao-msft yao-msft requested a review from a team as a code owner June 12, 2026 02:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for mirroring the Windows host’s trusted root CA certificates into the wslc container VM so TLS operations (e.g., pushing to a private registry signed by an enterprise CA) can succeed without manual VM configuration.

Changes:

  • Add Windows certificate-store enumeration and install a PEM bundle into the VM during WSLCSession initialization (before containerd/dockerd start).
  • Extend WSLC E2E helpers to start a TLS-enabled local registry (bridge networking + cert volume mount).
  • Add an end-to-end TLS registry trust test that verifies failure before trust and success after adding the CA to a Windows trusted store.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/windows/wslc/e2e/WSLCE2ETlsRegistryTests.cpp New E2E test that generates a private CA/server cert and validates wslc push behavior before/after trusting the CA.
test/windows/wslc/e2e/WSLCE2EHelpers.h Exposes TestSession::Session() and updates StartLocalRegistry signature to support optional TLS cert directory.
test/windows/wslc/e2e/WSLCE2EHelpers.cpp Adds TLS path for local registry startup (bridge network, cert volume mount, readiness probe).
test/windows/CMakeLists.txt Links Ncrypt.lib for test-only CNG key generation used by the new TLS E2E test.
src/windows/wslcsession/WSLCSession.h Declares InstallTrustedRootCertificates() helper.
src/windows/wslcsession/WSLCSession.cpp Calls InstallTrustedRootCertificates() during session init and implements VM-side PEM bundle installation.
src/windows/wslcsession/WindowsCertStore.h Declares helper to collect host trusted roots as a PEM bundle.
src/windows/wslcsession/WindowsCertStore.cpp Implements trusted-root store enumeration and PEM serialization with deduplication.
src/windows/wslcsession/CMakeLists.txt Adds new WindowsCertStore source/header to the wslcsession target.

Comment thread src/windows/wslcsession/WindowsCertStore.cpp Outdated
Comment thread test/windows/wslc/e2e/WSLCE2ETlsRegistryTests.cpp
Comment thread test/windows/wslc/e2e/WSLCE2ETlsRegistryTests.cpp
Copilot AI review requested due to automatic review settings June 12, 2026 03:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread test/windows/wslc/e2e/WSLCE2ETlsRegistryTests.cpp
Comment thread src/windows/wslcsession/WindowsCertStore.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants