Skip to content

std.tls: on Windows a chain the store cannot complete is built once by CryptoAPI, which fetches the missing root (#2922) - #2926

Merged
ehartford merged 2 commits into
mainfrom
windows-roots-autoupdate
Nov 2, 2026
Merged

ehartford merged 2 commits into
mainfrom
windows-roots-autoupdate

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Windows seeds its trust store lazily: a root it has not met arrives from
Windows Update the first time CryptoAPI builds a chain through it. Our
verifier enumerates the store itself and never asked, so on a fresh
machine every root the machine had not met was missing: the release
runners (both architectures) verified github.com and refused zlib.net and
release-assets.githubusercontent.com with "peer verification failed"
(rehearsal 41395933232's fetch-diagnostics), while win10, with the roots
cached from earlier use, verified all three.

  • rt/windows_{x86_64,aarch64}.w: rt_tls_windows_complete_chain builds the
    server's chain through CryptoAPI (leaf context, the intermediates in a
    memory store, CertGetCertificateChain) and frees it; the build is what
    fills the store. Facade rows for the six CryptoAPI entry points.
  • rt_core.w: with_tls_windows_complete_chain; -1 on the other backends,
    whose PEM bundles are whole.
  • std.tls: a chain that does not end in a trusted root is built once by
    Windows, the roots reloaded, and the verdict is this verifier's again;
    WITH_TLS_TRACE names the root count and which check failed.

Eric Hartford added 2 commits November 2, 2026 01:24
…y CryptoAPI, which fetches the missing root (#2922)

Windows seeds its trust store lazily: a root it has not met arrives from
Windows Update the first time CryptoAPI builds a chain through it. Our
verifier enumerates the store itself and never asked, so on a fresh
machine every root the machine had not met was missing: the release
runners (both architectures) verified github.com and refused zlib.net and
release-assets.githubusercontent.com with "peer verification failed"
(rehearsal 41395933232's fetch-diagnostics), while win10, with the roots
cached from earlier use, verified all three.

- rt/windows_{x86_64,aarch64}.w: rt_tls_windows_complete_chain builds the
  server's chain through CryptoAPI (leaf context, the intermediates in a
  memory store, CertGetCertificateChain) and frees it; the build is what
  fills the store. Facade rows for the six CryptoAPI entry points.
- rt_core.w: with_tls_windows_complete_chain; -1 on the other backends,
  whose PEM bundles are whole.
- std.tls: a chain that does not end in a trusted root is built once by
  Windows, the roots reloaded, and the verdict is this verifier's again;
  WITH_TLS_TRACE names the root count and which check failed.
@ehartford
ehartford marked this pull request as ready for review November 2, 2026 06:49
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on bef85b9 (seed-driven, tools/battery.w); gate green before it. The Mac still fetches zlib.net through the new verify loop (128 roots, chain of 3, 1.5 MB); the Windows proof is the next test-channel rehearsal's arm and x86 release UATs.

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.

1 participant