-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RequestError: unable to verify the first certificate #46
Comments
Hello, As I understand your problem, your company is using a self-signed certificate for your HTTPS connection. It seems so far that there are no programmatic way of adding custom certs and nodejs is not picking custom certs from the OS store. But there is an environment variable to add custom certs: https://nodejs.org/docs/latest-v16.x/api/cli.html#node_extra_ca_certsfile
Unfortunately I'm not working in an environment with such self-signed cert so I'll let you test this solution and let me know if that works. That said, I found a package (https://www.npmjs.com/package/win-ca) that could be interesting for getting the custom certificates on Windows. I'll have to explore this a bit more and assess if it meets our security requirements before implementing it. |
Setting this environment variable up to point to a file containing the firewall's CA certificate allows me to successfully complete a A hardcoded certificate store seems like it might be problematic as it won't allow for situations such as CA certificates which are revoked or new ones that get added (e.g. Let's Encrypt). If you're able to verify against certificates in the OS certificate store this would be better as these are typically updated on a regular basis, and for enterprise use the OS certificate store will usually also contain any custom CA certificates that may be needed. |
Great that it solves the issue, it's clearly not ideal but it's something at least. Root certificates don't change that often (see the updates in https://github.com/nodejs/node/blob/main/src/node_root_certs.h) and I believe most providers will think of updating it there unless they want to break a lot of customers apps. I'll have a deeper look at how other apps handle this issue and I'll try to come up with a long term solution. |
I just figured out that there is an option to use the OpenSSL default CA's store instead of the Node.js one, as per https://nodejs.org/api/cli.html#--use-bundled-ca---use-openssl-ca (I believe this doesn't solve the issue on Windows as they use their own cert store) One solution could be to export this variable The previous method we talked about is also documented in our website now: https://dashlane.github.io/dashlane-cli/troubleshooting#requesterror-unable-to-verify-the-first-certificate I'm considering this issue closed as there is nothing we can integrate into the code of the CLI (I looked at the win-ca package and it's not an acceptable dependency) and the solution seems acceptable to me, please re-open if there is additional problems. |
dcli Version: 1.0.0 Windows
OS version: Windows 10 Enterprise 21H2
When trying to log in using
dcli-win.exe sync
I am receiving an error as follows after entering my email address:While it is the case that I am running this in a corporate environment with a firewall that does HTTPS inspection, the appropriate CA certificate is installed in the computer's Trusted Root Certificates store, so the server certificate should be able to be verified.
The Dashlane web app and browser extension do not experience any issues.
The text was updated successfully, but these errors were encountered: