SocketIO4NET with SSL - node.js

Getting "error initializing handshake" with the SocketIO4Net library when I try to connect using my https node/socket.io connection over SSL. Is SSL/WSS supported with SocketIO4Net?
SocketIO4Net with plain http works, and standard Socket.IO in JavaScript over plain http and over https SSL works. But not SocketIO4Net with SSL, yet. Must be missing something, but challenge debugging this one.
The source seems to indicate the message "Error Initializing handshake" means it's missing the socket id when it tries to connect to the node/socket server. Any ideas?

Got SocketIO4Net to work with SSL too. Needed to import the Self-Signed Cert into the Cert Auth chain on our QA middleware box that was running SocketIO4Net and calling our node server. Works great now!

Related

Can't connect with HTTPS but HTTP works fine

I'm trying to secure my we server using HTTPS and SSL/TLS to access my website. Going to the site by www.-----.------.compute-1.amazonaws.com works and the connection is successful. But when I try https://www.-----.------.compute-1.amazonaws.com chrome says "This site can’t be reached" "www.-----.------.compute-1.amazonaws.com refused to connect". I am using an Amazon Linux instance. Where did I go wrong?
Typical problem. I am assuming some things here.
You launched a EC2 (or something similar) Instance
Didn't Open 443 port or Configure it further.
Using port 80 for serving pages.
I think you got the answer. Check this out.
I needed an SSL certificate from a CA (certificate authority). I was using a self-signed certificate which doesn't work in a browser.

Adding SSL to CometD

I am using CometD library for nodejs on server side using the https://www.npmjs.com/package/cometd-nodejs-client. The server (Genesys) that I am trying to connect uses SSL, due to SSL cert I am getting SSL error when connecting to the server using CometD. My question is that is there a way to pass the ca cert to CometD library (https://www.npmjs.com/package/cometd)?
The XMLHttpRequest provided by the CometD library exposes a _config() function that returns a configuration object that is passed to Node's http.request(...), allowing you to configure TLS if so you need.
You can refer to this test case:
https://github.com/cometd/cometd-nodejs-client/blob/1.3.0/test/https.js#L53
I am also seeing a similar issue when using CometD and CometD Client packages to connect to Genesys.
I have a nodejs server that adds all the /meta/handshake, /meta/connect, /meta/disconnect... listeners. When I try to trigger the /meta/handshake I seeing SSL self signed certificate in certificate chain error. As a solution, I tried to install the ssl certificates on my server and tried to connect to Genesys but I still see the same self signed certificate error.
Is there a way to configure the listeners with rejectUnauthorized: false?

Is there a way to trust all certificates using socket.io-client in node?

Right now I wanna have a node client, for my socket.io application.
The problem I am having is that I wanna connect to the server using a https connection, but the server is using a self-signed certificate, and I wanna be able to allow all certificates with socket.io-client, otherwise the client rejects the connection.
I am writing a node client, and there are no browsers involved.
So is there any options to trust all certficates or to allow only some with socket.io-client?
Thank you very much.

OpenShift Node.js CERT_UNTRUSTED

Note: this has nothing to do with NPM (which is what comes up the most when googling this error):
I have a Node server which is trying to make https calls to a IIS/.Net server. My understanding is that when my Node server is playing the part of the "client" I don't need to attach any certificates to the options (var Request = Https.request(Options, function(Response) { ... }); ), however, recently when the IIS/.Net server updated its certificates, Node started throwing CERT_UNTRUSTED errors.
The obvious culprit is the IIS.Net server and/or its certificates, however, that server can be successfully reached by non-Node servers (or fiddler, for example).
The other oddity is that all this code was working fine till the certificates on the IIs.Net server expired and were reset.
Thanks in advance!
I got this to work using the answer found at a similar post:
Unable to verify leaf signature
Still not sure why renewing the certificates caused this to happen, but either way, the ssl-root-cas/latest module did the trick.

secure websocket for https

I have a local PHP server for my website and a local PHP server for websocket but websockets doesn't work anymore since I installed self-signed SSL certificats in WAMP. I have read that I have to use wss:// but when I change ws://localhost/xxx/server.php to wss://xxx/server.php but it doesn't solve my problem. I have accepted the certificat in firefox and chrome but it doesn't change anything. Any idea of what i supposed to do to repair websocket? Do I have to install certificat or key in my websocket PHP server?
You have to put the same certificate for the web page, and access the page with https://, therefore the browser will prompt you to accept the self-signed certificate and the websocket will be able of connecting using ws://
Also, be sure you use different ports for ws:// and wss://, some browsers get messed up if you start changing the connection of the same port.

Resources