I have had this problem for quite some time, but I could not figure it out. Nothing I try really works at all. From converting ssl files to many different formats and checking permissions on a folder, nothing works (or, to be more explicit, everything is the same as it should work). Does anyone know what can be disabled? Thank you very much for your help, I get to the desperate side at this moment ...
Could this be version related? . How can I check if this is the case?
Here is my code:
var ssl_options = { pfx : fs.readFileSync(my_pfx_path), passphrase: 'password' }; //OR var ssl_options = { key : fs.readFileSync(my_key_path), cert : fs.readFileSync(my_cert_path) }; var protocol = "https"; preparedApp = require(protocol).createServer(ssl_options,app); var io = require('socket.io')(preparedApp); preparedApp.listen(8080, function(){}); io.on('connection', function(socket){});
And here is the log of my ssl_options ...
{ key: <Buffer 41 ...>, cert: <Buffer 4a ...> }
These are errors with an error in the header throw new Error('Missing PFX or certificate + private key.'); .
Full trace log:
Error: Missing PFX or certificate + private key. at Server (tls.js:1127:11) at new Server (https.js:35:14) at Object.Server (https.js:29:41) at Object.<anonymous> (/nginx/script.js:477:34) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16)
Can anyone give me a helping hand? tyvm ...
I am using socket.io version 1.3.7. The certificate works with regular https in the /nonsocket.io browser. The files are correct, so I really don't know why this should happen
source share