尝试使用node-http-proxy创建HTTPS代理服务器,
我拥有公司签名的CA证书,并试图在节点js中读取它们
let fs = require('fs')
let key = fs.readFileSync('/some-key.key')
let cert = fs.readFileSync('/some.crt')
let options = {
key: key,
cert: cert
}
我正在用来创建代理服务器的那一行
https.createServer(options, function(req, res) {
...
})
我看到的是以下错误,
_tls_common.js:69
c.context.setCert(options.cert);
^
Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
at Error (native)
at Object.createSecureContext (_tls_common.js:69:17)
at Server (_tls_wrap.js:775:25)
at new Server (https.js:26:14)
at Object.exports.createServer (https.js:47:10)
at Object.<anonymous> (/opt/xcal/apps/LambdaProxy/server.js:17:20)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
调查了可用但无济于事的其他问题和链接。 在节点版本为6.14.x的Centos 7.3上运行