Using https with socket.io 1.0.6 and getting an ERR_SSL_PROTOCOL_ERROR
See original GitHub issueI’ve been using https with socket.io on version 0.9 and below successfully for years. I went to upgrade to the new 1.0 version and I’m getting an SSL error. Here is the server-side node.js code to start the socket server:
var options = {};
options.key = fs.readFileSync('certs/ssh.key');
options.cert = fs.readFileSync('certs/cert.key'); //I've also tried using the property 'certificate' instead of 'cert'
var io = require('socket.io').listen(9091,options);
The connection works fine over standard http but https is giving me the error: ERR_SSL_PROTOCOL_ERROR
I know that all certificate file references are good. There seems to be no documentation on how to implement https socket.io connections on version 1.0, so I’m at a loss. Any help is much appreciated.
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
node.js - Using https with socket.io 1.0.6 and getting an ...
I went to upgrade to the new 1.0 version and I'm getting an SSL error. Here is the server-side node.js code to start...
Read more >Troubleshooting connection issues | Socket.IO
First and foremost, please note that disconnections are common and expected, even on a stable Internet connection:
Read more >Everything you need to know about Socket.IO - Ably Realtime
A popular way to demonstrate the two-way communication Socket.IO provides is a basic chat app (we talk about some other use cases below)....
Read more >ngx-socket-io - npm
Make sure you're using the proper corresponding version of socket.io on the server. Package Version, Socket-io Server Version, Angular version ...
Read more >Use HTTPS / Socket.io in development environment
GET https ://develop.[domain].com:9000/socket.io/?EIO=3&transport=polling&t=Mfq3F1I net::ERR_CONNECTION_CLOSED libs.min.js?ver=1556712335.0:1234:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
try binding to an http server first using express or the like using https, then attach Socket.IO to that.
That issue was closed automatically. Please check if your issue is fixed with the latest release, and reopen if needed (with a fiddle reproducing the issue if possible).