Skip to content

tlsconfig: make root pool tests deterministic across platforms#154

Open
thaJeztah wants to merge 3 commits intodocker:mainfrom
thaJeztah:fix_non_linux_tests
Open

tlsconfig: make root pool tests deterministic across platforms#154
thaJeztah wants to merge 3 commits intodocker:mainfrom
thaJeztah:fix_non_linux_tests

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Mar 24, 2026

tlsconfig: make root pool tests deterministic across platforms

The existing tests relied on x509.SystemCertPool behaving as a
regular in-memory cert pool. This assumption only holds on Linux;
on macOS and Windows the pool delegates to platform APIs, leading
to non-deterministic behavior and test failures.

Refactor tests to:

  • inject a fake "system" cert pool backed by generated test roots
  • verify leaf certificates instead of root certificates
  • avoid reliance on host trust stores

This makes the tests portable and deterministic while still
validating the intended semantics of ExclusiveRootPools.

Note: real system pool behavior remains platform-dependent and
would ideally be covered by integration tests.

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah marked this pull request as draft March 24, 2026 19:53
@thaJeztah thaJeztah force-pushed the fix_non_linux_tests branch 3 times, most recently from d682d12 to 8927b61 Compare March 24, 2026 19:57
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The existing tests relied on x509.SystemCertPool behaving as a
regular in-memory cert pool. This assumption only holds on Linux;
on macOS and Windows the pool delegates to platform APIs, leading
to non-deterministic behavior and test failures.

Refactor tests to:
- inject a fake "system" cert pool backed by generated test roots
- verify leaf certificates instead of root certificates
- avoid reliance on host trust stores

This makes the tests portable and deterministic while still
validating the intended semantics of ExclusiveRootPools.

Note: real system pool behavior remains platform-dependent and
would ideally be covered by integration tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the fix_non_linux_tests branch from 8927b61 to b4454a6 Compare March 25, 2026 12:21
@thaJeztah thaJeztah marked this pull request as ready for review March 25, 2026 12:21
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.

Investigate why TestConfigServerExclusiveRootPools is broken on Windows / MacOS builds

1 participant