小编Doc*_*0rZ的帖子

Node.js - 将https.request()与内部CA一起使用

我是谁让https.request()信任我的内部签名服务器证书.这是我在v0.10.25中运行的代码的快速示例:

var options = {
     hostname: 'encrypted.mydomain.local',
     port: 443,
     path: '/',
     method: 'GET'
};

var https = require('https')
https.request(options)
Run Code Online (Sandbox Code Playgroud)

我在Windows系统上运行它,我的内部根CA在系统级别受信任,但每当我发出这样的请求时,我都会得到异常

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: CERT_UNTRUSTED
    at SecurePair.<anonymous> (tls.js:1370:32)
    at SecurePair.EventEmitter.emit (events.js:92:17)
    at SecurePair.maybeInitFinished (tls.js:982:10)
    at CleartextStream.read [as _read] (tls.js:469:13)
    at CleartextStream.Readable.read (_stream_readable.js:320:10)
    at EncryptedStream.write [as _write] (tls.js:366:25)
    at doWrite (_stream_writable.js:223:10)
    at writeOrBuffer (_stream_writable.js:213:5)
    at EncryptedStream.Writable.write (_stream_writable.js:180:11)
    at write (_stream_readable.js:583:24)
Run Code Online (Sandbox Code Playgroud)

更详细一点,这一切都发生在我试图用于身份验证的node-atlassian-crowd模块内部

ssl https node.js atlassian-crowd

4
推荐指数
1
解决办法
8050
查看次数

标签 统计

atlassian-crowd ×1

https ×1

node.js ×1

ssl ×1