node-xcs
node-xcs copied to clipboard
exception on xcs.start after updating to 0.1.8
windows 10, node 14.18.1
var xcs = new Sender(...)
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.
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'
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;