Error during WebSocket handshake: Unexpected response code: 400 on https - node.js

I am getting below error when I installed the ssl certificate for my domain. So I have changed websocket URL begin with ws:// to wss:// but I am getting this error.
I am using Amazon Linux, docker with jenkins. Backend is in Node JS. Front is Angular JS (1).
Anyone can help us on that?

Related

Electron.js Connection Problem with openvidu

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

How can I setup NODE_TLS for SSR Angular on Azure?

I have this SSR Angular web application that when I run (locally and production) I get the following warning
(node:6172) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
That's because I have the following line on my server (express-engine) file
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
If I remove that line, the requests to my API (HttpClient) will not work, giving the following error
'Http failure response for https://localhost:5000/: 0 Unknown Error'
So, how can I fix this in any environment? What could I be doing not to ignore the warning but set it right so I can keep the requests working and not using NODE_TLS_REJECT_UNAUTHORIZED?
Angular Universal does not wait for api/http request before render

Cannot read property 'NODE_ENV' of undefined in nodejs on https SSL

I have install the ssl certificate in my angular and nodejs project. but after installing the certificate i am unable to login into my application. My main index.js file is running perfectly, but when i am tried to login from my application, it showingn me 500 (Internal Server Error) with a message (Cannot read property 'NODE_ENV' of undefined). I am showing you the localhost but the same problem is coming on production.Please help me out here, how can i fix it.
My error image of application
My nodejs console working picture
It's not HTTPS SSL problem.
Seems that the problem is on the file which defines a handler for POST /login, attach this file for more details.

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)

Resources