I am trying to connect with secured websocket using nodejs using ws library.Server is also using same ws library.
My ios and chrome webapp is able to connect to secured websocket
But as soon as I am trying to connect through a Linux based system the error thrown:
throw er; // Unhandled 'error' event
at SecurePair.<anonymous> (tls.js:1289:32)
at SecurePair.EventEmitter.emit (events.js:94:17)
at SecurePair.maybeInitFinished (tls.js:896:10)
at CleartextStream.read [as _read] (tls.js:430:15)
at CleartextStream.Readable.read (_stream_readable.js:304:10)
at EncryptedStream.write [as _write] (tls.js:344:25)
at doWrite (_stream_writable.js:250:12)
at writeOrBuffer (_stream_writable.js:237:5)
at EncryptedStream.Writable.write (_stream_writable.js:184:11)
at write (_stream_readable.js:557:24)
My code snippet is:
/*Websocket client ; gateway will intiate the connection to cloud*/
var WebSocket = require('ws');
var connection_client = new WebSocket('wss://IP:1337/macadd=' + process.argv +'&platform=gateway'
Any help will be really appreciated.
CERT_UNTRUSTED may mean you are using a self-signed certificate that has not been trusted. Put the same certificate for HTTPS and WSS so the browser can prompt the user for trusting it.