guness / node-xcs

NodeJS implementation of Google's XMPP Connection Server
BSD 2-Clause "Simplified" License
38 stars 23 forks source link

exception on xcs.start after updating to 0.1.8 #43

Open freerider7777 opened 1 year ago

freerider7777 commented 1 year ago

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 commented 1 year ago

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'

AdamRatcliffe-TomTom commented 1 year ago

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;