I want a socket with socket.io over SSL. I read other answers but nothing worked
Here is my code:
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.'); . Does anyone know what could happen? None of the other solutions to this answer resolved my case.
source share