I'm pretty much following this tutorial (all other tutorials I found look the same)
http://www.hacksparrow.com/express-js-https.html
My code is as follows:
// 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'));
});
The app starts fine after sudo node app
Express server listening on port 443
Now when I curl
curl https://localhost/
I get
curl: (35) Unknown SSL protocol error in connection to localhost:443
Any ideas?