Skip to content

crypto: avoid network access loading system CAs - #65765

Open
chrmarti wants to merge 3 commits into
nodejs:mainfrom
chrmarti:chrmarti/disable-system-ca-network-fetch
Open

crypto: avoid network access loading system CAs#65765
chrmarti wants to merge 3 commits into
nodejs:mainfrom
chrmarti:chrmarti/disable-system-ca-network-fetch

Conversation

@chrmarti

@chrmarti chrmarti commented Sep 3, 2026

Copy link
Copy Markdown

Keep the existing macOS SSL client policy when filtering system certificates, but disable network access with SecTrustSetNetworkFetchAllowed before SecTrustEvaluateWithError. This prevents AIA issuer downloads and revocation requests while building the system CA cache without changing which certificates pass the fallback evaluation.

Add an opt-in macOS regression test with pinned certificates and a local AIA/OCSP responder. The test verifies that Node.js system CA enumeration makes no requests, while macOS certificate validation confirms that the generated endpoints are reachable.

Fixes: #63313

Tests:

  • make -j8
  • all test/system-ca/test-*.js and test-*.mjs files
  • make lint-js
  • make lint-cpp

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Sep 3, 2026
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.06%. Comparing base (144e679) to head (c88245e).
⚠️ Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65765      +/-   ##
==========================================
+ Coverage   89.95%   90.06%   +0.10%     
==========================================
  Files         757      769      +12     
  Lines      258080   261316    +3236     
  Branches    48933    49629     +696     
==========================================
+ Hits       232168   235342    +3174     
- Misses      16971    17029      +58     
- Partials     8941     8945       +4     
Files with missing lines Coverage Δ
src/crypto/crypto_context.cc 71.66% <ø> (ø)

... and 78 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Use the purpose-neutral Basic X.509 policy when enumerating macOS
system certificates. Verify that enumeration does not fetch AIA or OCSP
resources.

Assisted-by: AI coding assistant
Signed-off-by: Christof Marti <chrmarti@microsoft.com>
Replace runtime certificate generation with checked-in fixtures and
Makefile targets for the macOS system CA network test.

Assisted-by: AI coding assistant
Signed-off-by: Christof Marti <chrmarti@microsoft.com>
@chrmarti
chrmarti force-pushed the chrmarti/disable-system-ca-network-fetch branch from 7e40c26 to a5c25cf Compare September 4, 2026 07:24
Keep the existing SSL client policy and explicitly disable network
access. This avoids AIA and revocation requests without changing which
certificates pass the fallback evaluation.

Assisted-by: AI coding assistant
Signed-off-by: Christof Marti <chrmarti@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: tls.getCACertificates('system') uses revocation-enabled trust policy, causing 5-10s startup on machines with network filters

2 participants