最近、Node 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: '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
しますが、Node 0.10.5 で強化されたセキュリティを利用したいと考えています。
Python httplib2 (${python}/Lib/site-packages/httplib2/cacerts.txt) および cURL ("curl-ca-bundle.crt") で動作するため、私の .pem ファイルは優れていると思います。