Node.js https.request的内部证书颁发机构(CA):如何指向.PEM?
我最近从节点0.8.xx更新到了0.10.5。突然,我的https.request调用开始失败。我相信0.8.x不是在验证证书,但0.10.5是。我们建立了一些内部证书颁发机构来验证内部https流量。我想向Node.js https.request客户端显示证书。我该怎么做 目前,我得到:Node.js https.request的内部证书颁发机构(CA):如何指向.PEM?,node.js,https,certificate,ssl-certificate,Node.js,Https,Certificate,Ssl Certificate,我最近从节点0.8.xx更新到了0.10.5。突然,我的https.request调用开始失败。我相信0.8.x不是在验证证书,但0.10.5是。我们建立了一些内部证书颁发机构来验证内部https流量。我想向Node.js https.request客户端显示证书。我该怎么做 目前,我得到: Problem with request: UNABLE_TO_VERIFY_LEAF_SIGNATURE 我试过: var https_request_options = { host: 'm
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”)一起工作。好吧,也许这些有帮助
/which/path/
必须是项目的相对文件夹