在终端上执行命令时获取CERT_UNTRUSTED

时间:2014-02-06 07:00:20

标签: node.js ssl-certificate npm

我的系统上安装了节点(v0.10.22) npm(1.3.14)

我正在尝试执行以下命令。

echo "require('https').request({host: 'host.net'}, function(res){console.log(res.statusCode)}).end()" | NPM_DEBUG=https node

并在终端上收到错误

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: CERT_UNTRUSTED
    at SecurePair.<anonymous> (tls.js:1362:32)
    at SecurePair.EventEmitter.emit (events.js:92:17)
    at SecurePair.maybeInitFinished (tls.js:974:10)
    at CleartextStream.read [as _read] (tls.js:462:15)
    at CleartextStream.Readable.read (_stream_readable.js:320:10)
    at EncryptedStream.write [as _write] (tls.js:366:25)
    at doWrite (_stream_writable.js:221:10)
    at writeOrBuffer (_stream_writable.js:211:5)
    at EncryptedStream.Writable.write (_stream_writable.js:180:11)
    at write (_stream_readable.js:583:24)

上述命令可以正常使用节点(v0.6.12),但不能用于节点(v0.10.22)

我也尝试了下面的东西,但仍然无法正常工作

npm config set strict-ssl false
npm config set ca ""

有人可以帮忙吗?

0 个答案:

没有答案