前提・実現したいこと
クライアント証明書が必要なサーバにNodejsでアクセスしたい。
発生している問題・エラーメッセージ
Error: getaddrinfo ENOTFOUND https://xxxxxx https://xxxxx at errnoException (dns.js:28:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26) code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'https://xxxxx', host: 'https://xxxxx', port: 443 }
該当のソースコード
var fs = require('fs'); var https = require('https'); var headers = { 'Content-Type': 'text/html;charset=utf-8' }; var options = { agent: false, host: 'https://xxxxx', port: 443, path: '/', method: 'GET', headers:headers, cert: fs.readFileSync('R1012838.pem') }; var req = https.request(options, function(res) { console.log(res); }); req.on('error', (e) => { console.error(e); }); req.end();
試したこと
curlで実行すると、サイトのHTMLが返ってくる。
curl https://xxxxx -E ./R1012838.pem
補足情報(FW/ツールのバージョンなど)
nodejs:v6.11.3
npm:3.10.10

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/03 11:51
2018/09/04 04:10
2018/09/04 09:41
2018/09/05 01:51
2018/09/06 06:26