[英]node https get request to public api results in Error: CERT_UNTRUSTED
trying to perform a simple https request to a public api but i'm getting "Error: CERT_UNTRUSTED" 尝试对公共API执行简单的https请求,但我收到“错误:CERT_UNTRUSTED”
require('https');
var options = {
host: 'btc-e.com',
path: '/api/2/btc_usd/ticker',
port: '443',
method: 'GET',
headers: {accept:'*/*'}
};
var req = https.get(options, function(res) {
console.log(res.statusCode);
res.on('data', function(d) {
process.stdout.write(d);
});
});
req.on('error', function(e) {
console.error(e);
});
solved it! 解决了! I just had to update my node installation using the following commands:
我只需要使用以下命令来更新节点安装:
sudo npm cache clean -f sudo npm install -gn sudo n stable sudo npm cache clean -f sudo npm install -gn sudo n稳定
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.