我非常关注本教程(我发现的所有其他教程看起来都一样)
http://www.hacksparrow.com/express-js-https.html
我的代码如下:
// dependencies
var express = require('express')
, https = require('https')
, fs = require('fs');
var privateKey = fs.readFileSync('./ssl/rp-key.pem').toString();
var certificate = fs.readFileSync('./ssl/rp-cert.pem').toString();
var app = express.createServer({
key : privateKey
, cert : certificate
});
...
// start server
https.createServer(app).listen(app.get('port'), function(){
console.log("Express server listening on port " + app.get('port'));
});
该应用程序在 sudo node app 之后启动正常
Express server listening on port 443
现在当我卷曲
curl https://localhost/
我明白了
curl: (35) Unknown SSL protocol error in connection to localhost:443
有任何想法吗?