You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vscode/proxy-agent uses untrusted certificates on macOS #247003
this returns all the certificates in the keychain, regardless of trust settings. by default, when installing a new cert on modern version of macOS, it is not trusted:
contrast this with the new --use-system-ca flag in nodejs v23, which looks at the individual trust settings of each imported cert:
TrustStatusIsTrustSettingsTrustedForPolicy(CFArrayReftrust_settings,
boolis_self_issued) {
// The trust_settings parameter can return a valid but empty CFArrayRef.// This empty trust-settings array means “always trust this certificate”// with an overall trust setting for the certificate of// kSecTrustSettingsResultTrustRootif (CFArrayGetCount(trust_settings) ==0) {
returnis_self_issued ? TrustStatus::TRUSTED : TrustStatus::UNSPECIFIED;
}
Verify that the configured Node.js request fails with a certificate trust error. An untrusted certificate must not be accepted merely because it is present in the Keychain.
In Keychain Access, change the certificate to Always Trust.
Fully quit and restart VS Code Insiders, then repeat the connection test.
Verify that the configured Node.js request now succeeds.
Change the certificate back to Never Trust, restart Insiders, and confirm that the request fails again.
Stop the HTTPS server, delete the certificate from Keychain Access, and remove the temporary files.
Expected: With http.systemCertificatesNode enabled by default, Node.js honors the macOS trust settings: the certificate is accepted when set to Always Trust and rejected when set to Never Trust.
Activity
chrmarti commentedon Apr 22, 2025
It looks like
security verify-certcan be used to check trust on each CAs.chrmarti commentedon Apr 24, 2025
Node.js 22.x is getting support for reading OS certificates on Windows and macOS: nodejs/node#57840
chrmarti commentedon Aug 28, 2026
Fixed with #332504.
chrmarti commentedon Aug 28, 2026
Steps to Verify
On macOS, install the latest VS Code Insiders build containing Enable Node.js system certificates by default #332504.
Remove any explicit
http.systemCertificatesNodevalue from the Default profile’s User Settings, confirming the new default is exercised.Create a self-signed certificate for
localhostusing the command below.Add
localhost-cert.pemto the macOS login Keychain.In Keychain Access, open the certificate, expand Trust, and select Never Trust.
Start the local HTTPS server using the command below.
Fully quit and restart VS Code Insiders so system certificates are reloaded.
Use the Network Proxy Test extension’s Network Proxy Test: Test Connection command with:
Verify that the configured Node.js request fails with a certificate trust error. An untrusted certificate must not be accepted merely because it is present in the Keychain.
In Keychain Access, change the certificate to Always Trust.
Fully quit and restart VS Code Insiders, then repeat the connection test.
Verify that the configured Node.js request now succeeds.
Change the certificate back to Never Trust, restart Insiders, and confirm that the request fails again.
Stop the HTTPS server, delete the certificate from Keychain Access, and remove the temporary files.
Expected: With
http.systemCertificatesNodeenabled by default, Node.js honors the macOS trust settings: the certificate is accepted when set to Always Trust and rejected when set to Never Trust.Create the Self-Signed Certificate
Run the Local HTTPS Server
From
/tmp/vscode-system-ca-test, run:Keep the server running while testing. Stop it afterward with
Ctrl+C.