NodeJS UNABLE_TO_VERIFY_LEAF_SIGNATURE

前端 未结 7 1494
鱼传尺愫
鱼传尺愫 2021-02-04 00:36

We\'re trying to use Node.js (and Mocha) as a testing framework to test API calls against an internal server over https. We\'re using the following node modules: Mocha, Restify

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-04 00:57

    Try something like:

    cas = [fs.readFileSync("[path to our CA cert file]"],
    https.globalAgent.options.ca = cas;
    

    Taken from http://permalink.gmane.org/gmane.comp.mozilla.identity.devel/3762

    It worked for me where all other solutions failed, it seems that this needs to be applied on the global agent.

提交回复
热议问题