I am using node-ssl-root-cas as I was getting UNABLE_TO_VERIFY_LEAF_SIGNATURE errors whilst connecting to a HTTPS web server.
With the node-ssl-root-cas library, I am able to add the required CA certificates:
require('ssl-root-cas')
.addFile(__dirname + '/rapidssl_1.crt')
.addFile(__dirname + '/rapidssl_2.crt');
However, this prevents Stripe requests from being made in the node app. I get the following error when making a Stripe request.
rawType: undefined,
code: undefined,
param: undefined,
message: 'An error occurred with our connection to Stripe',
detail: { [Error: certificate not trusted] code: 'CERT_UNTRUSTED' },
raw:
{ message: 'An error occurred with our connection to Stripe',
detail: { [Error: certificate not trusted] code: 'CERT_UNTRUSTED' } } }
When I remove require('ssl-root-cas') Stripe requests succeed but my requests to my HTTPS web service then fail again.
It looks like node-ssl-root-cas doesn't include the required CA certificates for Stripe?