使用node-ssl-root-cas库进行分条

我正在使用node-ssl-root-cas,因为在连接到HTTPS Web服务器时,出现了UNABLE_TO_VERIFY_LEAF_SIGNATURE错误。

使用node-ssl-root-cas库,我可以添加所需的CA证书:

require('ssl-root-cas') .addFile(__dirname + '/rapidssl_1.crt') .addFile(__dirname + '/rapidssl_2.crt'); 

但是,这可以防止在节点应用程序中进行条带请求。 进行条纹请求时出现以下错误。

  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' } } } 

当我删除require('ssl-root-cas')分段请求成功,但是我的HTTPS Web服务请求再次失败。

它看起来像node-ssl-root-cas不包括Stripe所需的CA证书?