-
Notifications
You must be signed in to change notification settings - Fork 815
Open
Description
Issue
CaStore expects all certificates to use RSA. If this is not the case, as on some Windows machines, it breaks.
Code
Run this in the node
interactive interpreter.
const { getCACertificates } = await import("tls");
const forge = require('node-forge');
const pki = forge.pki;
let caStore = pki.createCaStore(getCACertificates("system"));
Expected Behavior
caStore is successfully created.
Actual Behavior
Received the following Error:
Uncaught Error: Cannot read public key. OID is not RSA.
at pki.certificateFromAsn1 (...\node_modules\node-forge\lib\x509.js:1316:11)
at pki.certificateFromPem (...\node_modules\node-forge\lib\x509.js:822:14)
at caStore.addCertificate (...\node_modules\node-forge\lib\x509.js:2694:24)
at pki.createCaStore (...\node_modules\node-forge\lib\x509.js:2834:15)
Additional information
node --version
v22.16.0
systeminfo
OS Name: Microsoft Windows 10 Enterprise LTSC
OS Version: 10.0.19044 N/A Build 19044
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Workstation
OS Build Type: Multiprocessor Free
Yiming075
Metadata
Metadata
Assignees
Labels
No labels