A (simple) chat is part of an application I've created a while back. Today I'm switching the website from http to https. Therefore I also have to SSL my Socket.io chat socket, otherwise browsers will whine.
For some reason though my chatserver isn't presenting any certificate at all. Using openssl on linux confirms this:
openssl s_client -connect my.subdomain.tld:1337 -servername my.subdomain.tld -ssl3
returns
CONNECTED(00000003)
140136057653064:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:596:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : SSLv3
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
Start Time: 1436357417
Timeout : 7200 (sec)
Verify return code: 0 (ok)
---
I obviously replaced the domains. The port is actually 1337 and the server uses SNI so I believe I have to use the -servername argument?
My Node server (simplified):
var fs = require('fs');
var privateKey = fs.readFileSync('/home/ssl_certificates/my_subdomain_tld.key').toString();
var certificate = fs.readFileSync('/home/ssl_certificates/my_subdomain_tld.crt').toString();
var ca = fs.readFileSync('/home/ssl_certificates/AddTrustExternalCARoot.crt').toString();
var io = require('socket.io').listen(1337, {key: privateKey, cert: certificate, 'ca': ca});
The certificates do exist at that location and they are valid (double checked). How can I go about debugging this? Why is Socket.IO not presenting a certificate?