`tls.getCACertificates("default")` always returns an empty list when using `--use-openssl-ca`
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.3k
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 283
説明
Version
v26.4.0
Platform
Linux jvm1 6.17.0-1025-oem #25-Ubuntu SMP PREEMPT_DYNAMIC Fri May 29 12:11:29 UTC 2026 x86_64 GNU/Linux
Subsystem
tls
What steps will reproduce the bug?
- Run
NODE_OPTIONS="--use-openssl-ca" node -e 'console.log("Default certificates:", tls.getCACertificates("default")); fetch("https://example.org").then(rsp => console.log("HTTP status code:", rsp.status));'
Its output (provided your default OpenSSL certs are fairly standard) will be:
Default certificates: []
HTTP status code: 200
As can be seen, the request to https://example.org succeeds despite us having no default certificates according to tls.getCACertificates("default")
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
I would expect tls.getCACertificates("default") to return the certificates provided by OpenSSL that NodeJS uses to verify the certificate chain. I expect this since the documentation for the "default" type in tls.getCACertificates states: "return the CA certificates that will be used by the Node.js TLS clients by default".
What do you see instead?
An empty array
Additional information
Invoking tls.setDefaultCACertificates([]) and fetching https://example.org afterwards does cause UNABLE_TO_GET_ISSUER_CERT_LOCALLY
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、報告された NODE_OPTIONS="--use-openssl-ca" の再現手順を実行し、tls サブシステムの tls.getCACertificates("default") エントリポイントを調査します。その結果を fetch が使用する証明書、および tls.setDefaultCACertificates([]) の後の挙動と比較します。デフォルトのリストが検証に使用される OpenSSL 証明書を反映し、再現手順がテストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, linux, node.js
- 領域
- backend, security
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 54/100