node-xcs icon indicating copy to clipboard operation
node-xcs copied to clipboard

exception on xcs.start after updating to 0.1.8

Open freerider7777 opened this issue 2 years ago • 2 comments

windows 10, node 14.18.1

var xcs = new Sender(...) xcs.start();

TypeError: this.client.socket.setTimeout is not a function at Sender.start (C:...\FCM_XMPPServer\node_modules\node-xcs\google\Sender.js:146:24) at Object. (C:...\FCM_XMPPServer\Index.js:424:7) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) at internal/main/run_main_module.js:17:47

freerider7777 avatar Oct 07 '22 07:10 freerider7777

If we ignore it, we get the other error

Error: self signed certificate at TLSSocket.onConnectSecure (_tls_wrap.js:1515:34) at TLSSocket.emit (events.js:400:28) at TLSSocket._finishInit (_tls_wrap.js:937:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:709:12) { code: 'DEPTH_ZERO_SELF_SIGNED_CERT'

freerider7777 avatar Oct 07 '22 07:10 freerider7777

I also get this error on OSX, node 16.10.0.

I worked around it by calling xcs.client.start() to avoid the setTimeout() call on the null socket reference. I also needed to set process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0 to avoid the self signed certificate error;

AdamRatcliffe-TomTom avatar Oct 28 '22 20:10 AdamRatcliffe-TomTom