Node.js的内部证书颁发机构(CA)https.request:如何指向.PEM?

我最近从节点0.8.xx更新到0.10.5。 突然,我的https.request调用开始失败。 我相信0.8.x没有validation证书,但0.10.5是。 我们设置了一些内部authentication中心来validation内部httpsstream量。 我想显示Node.js https.request客户端的证书。 我该怎么做呢?

目前,我得到:

Problem with request: UNABLE_TO_VERIFY_LEAF_SIGNATURE 

我努力了:

 var https_request_options = { host: 'myhost.com', path: '/thepath', port: 443, method: 'POST', headers: { 'Content-type': "application/x-www-form-urlencoded", 'Content-length': thebody.length, }, // rejectUnauthorized: false, ca: [fs.readFileSync('/whatever/path/ca_certs.pem')] }; var authRequest = https.request(https_request_options, function(response) { .... 

如果我设置rejectUnauthorized: false ,调用工作,但我想开始利用节点0.10.5中的改进的安全性。

我相信我的.pem文件是好的,因为它可以与Python httplib2($ {python} /Lib/site-packages/httplib2/cacerts.txt)和cURL(“curl-ca-bundle.crt”)一起使用。

好吧,也许这些帮助,

/whatever/path/必须是你的proyect的相对文件夹。