如何设置连接服务器(节点)在HTTPS上工作? 错误:错误:0906D06C:PEM例程:PEM_read_bio:无起始行

我正在使用连接服务器,我需要在https下创build我的本地主机(即使证书无效)。

目前我正在使用以下脚本创build一个服务器列表在http://127.0.0.1:8080/

我需要将其设置为: https : //127.0.0.1 : 8080/

如何configuration连接服务器?

gulp.task('dev:connect', function () { // runs connect server for rapid development connect.server({ root: '' }); }); 

我也尝试这个,但没有成功:

 var https = require('https'); var options = { key: fs.readFileSync('b.key'), cert: fs.readFileSync('a.crt') }; var app = connect(); // error here object is not a function https.createServer(options, app).listen(8080); 

尝试运行以下,我认为关键是保护:

  $ openssl rsa -in b.key -out b-unprotected.key $ cat b-unprotected.key a.crt > a.pem 

让我知道这个是否奏效