我正在使用connect服务器,我需要在https下创建我的localhost(即使证书无效)。
目前我正在使用以下脚本在http://127.0.0.1:8080/
创建服务器列表我需要将其设置为:https://127.0.0.1:8080/
如何配置连接服务器?
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);
答案 0 :(得分:1)
尝试运行以下命令,我认为密钥是受保护的:
$ openssl rsa -in b.key -out b-unprotected.key
$ cat b-unprotected.key a.crt > a.pem
让我知道这是否有效