I’ve bought an SSL certificate (Geotrust chain, RapidSSL) and can’t seem to deploy it properly.
var certs = {
key: fs.readFileSync('cert/private.key'),
ca: [fs.readFileSync('cert/intermediate1.crt'),
fs.readFileSync('cert/intermediate2.crt')],
cert: fs.readFileSync('cert/public.crt')
}
https.createServer(certs, router).listen(443);
This snippet works perfectly fine (even without the ca attribute in certs) on this laptop (windows XP of OS’s) but not at all in my production enviroment (Arch Linux). (I’ve set a redirect in my HOSTS file so I get a full-out padlock)
NodeJS versions are irrelevant, I’ve tested with a very old one and it worked on the development computer. OpenSSL is up-to-date (1.0.0g).
I’m baffled by this problem. Firefox reports “ssl_error_rx_record_too_long” and Chrome just states “ERR_SSL_PROTOCOL_ERROR” other browsers are even less discriptive.
As it turns out port forwarding wasn’t set up properly (don’t trust your friends word when it comes to network setup).