Closed Xaekai closed 3 years ago
Error: Unable to load PFX certificate
at Object.createSecureContext (node:_tls_common:333:17)
at Object.connect (node:_tls_wrap:1601:48)
at Agent.createConnection (node:https:130:22)
at Agent.createSocket (node:_http_agent:323:26)
at Agent.addRequest (node:_http_agent:274:10)
at new ClientRequest (node:_http_client:314:16)
at request (node:https:326:10)
at XMLHttpRequest.send (/home/calvin/tmp/n15err/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js:495:17)
at Request.create (/home/calvin/tmp/n15err/node_modules/engine.io-client/lib/transports/polling-xhr.js:268:9)
at new Request (/home/calvin/tmp/n15err/node_modules/engine.io-client/lib/transports/polling-xhr.js:170:8)
The reason for the polling transport to fail is because it appears node.js changed the behavior of passing null
into various SSL options.
If you change this line: https://github.com/socketio/engine.io-client/blob/3.5.x/lib/socket.js#L89
this.pfx = opts.pfx || null;
to default to undefined
instead of null
, then the polling transport begins working again under node 15.
There is still the question of why the websocket transport is failing first (in the example you sent me, it's trying to connect to websocket first and fallback to polling); I suspect the reason is probably similar but I haven't checked.
It looks like the above code would affect both transports. So this is an engine.io issue -- wonder if they'd accept a PR. 3.5 is an old version, but it was recently updated (Dec 2020).
Issue filed against engine.io-client: https://github.com/socketio/engine.io-client/issues/654
I've discovered that socket.io-client running under Node 15 cannot establish a connection to CyTube.