Electron.js Connection Problem with openvidu - node.js

I have an project with vue electron builder and node.js.
While i sending request from Openvidu server, i have an error.
This error is;
webSocketWithReconnection.js?714c:61 WebSocket connection to 'wss://localhost:4443/openvidu' failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID
How can i fix.?

You must configure your Electron app to accept self-signed SSL certificates if you are going to use a local development OpenVidu deployment.
In your Electron app add: https://github.com/OpenVidu/openvidu-tutorials/blob/f39d38fe14ea48dcb17c4fff4c39cc198f36ab8a/openvidu-electron/src/main.js#L69-L74

Related

Axios request getting network error on Expo

I have an expo mobile application running on an Android emulator and I'm trying to make a request to a local Node.js API. The request is through HTTPS protocol so I created self-signed certificates to be able to try the application.
Every time I try to make a request to the API Axios throws a Network error.
Network Error
Stack trace:
http://192.168.1.35:19001/node_modules%5Cexpo%5CAppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:168381:25 in createError
http://192.168.1.35:19001/node_modules%5Cexpo%5CAppEntry.bundle? platform=ios&dev=true&hot=false&minify=false:168285:26 in handleError
node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
node_modules\react-native\Libraries\Network\XMLHttpRequest.js:600:10 in setReadyState
node_modules\react-native\Libraries\Network\XMLHttpRequest.js:395:6 in __didCompleteResponse
node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:189:10 in emit
node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0
node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in
callFunctionReturnFlushedQueue
[native code]:null in callFunctionReturnFlushedQueue
...
I tried the following:
Configuring the API IP on the mobile application as 10.0.2.2 as suggested in the GitHub issue and didn't work.
Testing the application without HTTPS, which works perfectly fine.
Testing my application on an iOS device, but it has the same behaviour as the Android emulator, it works with HTTP but it does not with HTTPS.
Accessing the HTTPS URL from the emulator's browser, which also works.
My HTTPS server is configured as follows:
const httpsServer = https.createServer(Certificate.getCertificate(), app);
httpsServer.listen(Environment.PORT, "0.0.0.0");
Logger.logInfo(`Listening on port ${Environment.PORT} under HTTPS protocol.`);
In order to create the self-signed certificates, I followed the Heroku guide

Nodejs - SSL Handshake logs

I am trying to debug cert issue in my node module which is running in kubernetes.
The node app is running as below. It is enabled with SSL.
node --max-old-space-size=2560 ./server/index.js
How can I enable the SSL handshake trace?
For Java app, -Djavax.net.debug=ssl,handshake
Is there any equivalent for node app?

socket.io-client-cpp does not connect to node app on Heroku via https

socket.io-client.cpp does not connect to node app on Heroku while Node JS socket.io-client does without any problem. Error is:
[2018-12-11 19:32:43] [connect] Successful connection
[2018-12-11 19:32:43] [error] handle_read_http_response error: websocketpp.transport:7 (End of File)
[2018-12-11 19:32:43] [info] Error getting remote endpoint: system:107
Changed URL from https to http://myapp.heroku.com - works now. Is it possible to connect via https as well? JS socket.io-client connects via secure connection without any problem.
Have built socket.io-client-cpp app with SIO_TLS in DEFINES (compiler flag: -DSIO_TLS) - connects via https fine now! This enables TLS support as mentioned here:
https://github.com/socketio/socket.io-client-cpp/pull/137

mern project deployment on live ssl

I want to deploy a mern project on ssl. Currently it is running on server with ip address but when I deploy it on ssl it is not running. It is working fine on http.
I have change on node modules transport-node and make it http to https.
1-I am using nginx as proxy server
When I deploy on ssl it give error:-
1-emitter.js?8a6f:50 OPTIONS https://privateIp:port/ net::ERR_SSL_PROTOCOL_ERROR
2-websocket.js?0f24:6 WebSocket connection to 'ws://privateip/sockjs-node/831/bocznd0p/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400
3- your request is http,while it is require https.(handshake problem)

Difficulties connecting to socket.io server with Ionic

An overview of my setup:
A socket.io/node server is being hosted/ran on a computer in my local network.
An Ionic app is attempting to connect to the socket.io/node server to send/receive messages.
If I run the app in the browser with 'ionic serve', I am able to connect to the socket.io/node server successfully.
If I run the app in the emulator or on my device, I am only able to connect to the socket.io/node server if I add the -l (livereload) flag (ionic run android -l).
Originally, I hosted the node server on a heroku instance. I had no troubles connecting with this setup from browser, phone, or emulator. I had to switch to running the node server on a local computer so I have access to a local database.
Any ideas what is going on?
I fixed it by adding 'http://' to the beginning of the connection string.
Not sure why Ionic's livereload enabled me to connect without the 'http'

Resources