`tls.getCACertificates("default")` always returns an empty list when using `--use-openssl-ca`
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 122k
- Fork
- 37.3k
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 283
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách chạy bản tái hiện được báo cáo NODE_OPTIONS="--use-openssl-ca" và kiểm tra điểm vào tls.getCACertificates("default") trong hệ thống con tls. So sánh kết quả của nó với các chứng chỉ được fetch sử dụng và hành vi sau khi gọi tls.setDefaultCACertificates([]). Công việc được hoàn tất khi danh sách mặc định phản ánh các chứng chỉ OpenSSL được sử dụng để xác minh và bản tái hiện có kiểm thử bao phủ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, linux, node.js
- Lĩnh vực
- backend, security
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 54/100