Troubleshooting
Error: unable to verify the first certificate
When making request from a server (e.g. Node.js) to .local domain over https, the server may not have access to the LocalCan’s Root Certificates which is trusted on macOS, or doesn’t accept self-signed certificates.
For example Node.js (and so, other JS server frameworks) only take into account CAs from Mozilla CA store as supplied by the current Node.js version.
There are 2 solutions (choose one):
-
Add
RootCA.pemto trusted CA list in your framework, so it can verify server certificate.In Node.js set
NODE_EXTRA_CA_CERTSenvironment variable to point toRootCA.pemThis could be done in couple ways, for example by editing
package.jsondev script, so every time you runnpm run devthis variable will be set.package.jsonJSON package.json... "scripts": { "dev": "NODE_EXTRA_CA_CERTS=/path/RootCa.pem node app.js" }, ... -
Disable certificate validity checks when making requests.
In Node.js there is a flag you can set to false
rejectUnauthorized: false
⚠️Note
Only make above changes in your development environment, not in production.
Only make above changes in your development environment, not in production.
© 2025 LocalCan™. All rights reserved.