I was running my node.js app with autosigned certificates. That was working pretty well, except I was forced to accept certificate every time I opened chrome. Then I bought an SSL certificate (actually a wildcard) from Gandi. And I'm currently trying to put the certificates in my nodeapp.
var http = require( "http" );
var https = require( "https" );
var fs = require( "fs" );
var url = require( "url" );
var crypto = require("crypto");
function start(route,handle) {
function onRequest(request, response) {
var pathname = url.parse(request.url).pathname;
//console.log("Requete recue pour le chemin "+pathname+".");
route(handle, pathname, response, request);
}
var options = {
key: fs.readFileSync('privatekey.pem').toString(),
cert: fs.readFileSync('certificate.pem').toString()
};
var app = https.createServer(options,onRequest);
var io = require('socket.io').listen( app );
io.set('log level', 1);
app.listen( 8080 );
io.sockets.on('connection', function (socket) {
});
console.log("Server's launching");
}
With the signed certificate, server's launching and running but everytime I call
https://mydomain/ or https://mydomain:8080/
I get a
Erreur 107 (net::ERR_SSL_PROTOCOL_ERROR) : Erreur de protocole SSL
Any idea ? How can I have more infos regarding the error ? Any help much appreciated...