question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for use_ssl_cert?

See original GitHub issue

Hey there, Recently I encountered SSL certificate errors while calling Azure AD graph API using this library:

[Error: unable to verify the first certificate] code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'

Then I looked it up and found this issue: Azure/azure-sdk-for-ruby#493, which seems pretty similar to my issue. The only problem - I couldn’t find anything similar to use_ssl_cert in the NodeJS SDK. So, my question is - what can I do?

Thanks! Omer

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
amarzaverycommented, Apr 4, 2017

Node.js has a static list of trusted cert authorities as can be seen here. If you are behind a corporate proxy or a firewall, it cannot verify the certificate and you get the above error. Hence to solve this issue, node.js provided a mechanism to users where they can provide their own system trusted certs to be added to the static list. node.js should then not fail on certificate verification.

Documentation of the environment variable:

NODE_EXTRA_CA_CERTS=file#

Added in: XXX When set, the well known “root” CAs (like VeriSign) will be extended with the extra certificates in file. The file should consist of one or more trusted certificates in PEM format. A message will be printed to stderr (once) if the file is missing or misformatted, but any errors are otherwise ignored.

Note that neither the well known nor extra certificates are used when the ca options property is explicitly specified for a TLS or HTTPS client or server.

Take a look at this issue on node.js github repo for more info. https://github.com/nodejs/node/issues/4175.

1reaction
amarzaverycommented, Mar 4, 2017

@omerlh - This was inherently a bug in node.js itself. node.js used a static list of trusted certs which were hard coded in code.

with new version of node.js v4.8.0 or 6.10.0, (documentation over here) you can set the following environment variable: set NODE_EXTRA_CA_CERTS=<path-to-pem-file> and run the script again. This should work fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use a TLS/SSL certificate in your code in Azure App Service
This how-to guide shows how to use public or private certificates in your application code. This approach to using certificates in your code ......
Read more >
How to use SSL Cert in Java Code in Azure App Service
I am trying to call a back-end API from Java Client which uses SSL authentication. For .Net there is a snippet available on...
Read more >
Use SSL-Cert for Panel: "Main"-IP has multiple customers on it...
Hi there, I got a SSL-Cert for my panel. The server uses different IPs. The Cert is created for the "main-IP" of the...
Read more >
How to Install an SSL Certificate on a Debian Server
To help you pick the ideal SSL certificate, we built a couple of exclusive SSL tools. ... You can use ssl-cert-check, a small...
Read more >
here we stand student book
We are supporting Israel and fighting antisemitism around the world. ... to encourage > people to use SSL-cert-based authentication in low-trust situations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found