我尝试读取使用来自Let's Encrypt的cerbot生成的证书并使用
生成https服务器var privateKey = fs.readFileSync('key-certbot.pem','utf8');
var certificate = fs.readFileSync('csr-certbot.pem','utf8');
var credentials = { key: privateKey, cert: certificate };
var httpsServer = https.createServer(credentials);
它失败并显示以下错误消息:
_tls_common.js:88
c.context.setCert(options.cert);
^
Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
at Object.createSecureContext (_tls_common.js:88:17)
at Server (_tls_wrap.js:803:25)
at new Server (https.js:54:14)
at Object.createServer (https.js:76:10)
at Object.<anonymous> (/Users/me/Desktop/TestHTTPS/test.js:16:25)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
在其他地方提出的解决方案无济于事:
“没有起跑线”是什么意思?