question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Secure Socket Client Connection Error "self signed certificate in certificate chain"

See original GitHub issue

I suppose if you take the given example but at the end of the client code you put wss instead of ws the error is reported when trying to connect from another nodejs server as a client.

Connect Error: self signed certificate in certificate chain

I have indeed for now properly working self signed certificates and a Certificate Authority CA that is self signed. I’ve also tried adding to npm the cafile key and filename, (in “config” and out). https://docs.npmjs.com/misc/config#cafile [note: it’s just for the registry, and unrelated]

so secure connections are rejected if self signed, and there doesn’t seem to be anything I can do about it?! What am I missing or is this a feature request other then the bug it’s feeling like. It’s hard to believe no one noticed and fixed this before, so I figure I need a help sorting out the issue, thanks. I guess the question is is there somewhere I put my CA.cert for accepting self signed certificates?

I’m seeing https://github.com/theturtle32/WebSocket-Node/blob/master/lib/WebSocketClient.js#L115

WebSocketClient.prototype.connect = function(requestUrl, protocols, origin, headers, extraRequestOptions) {

for the first time digging into the code (so maybe I missed some docs too?). something in the tlsOptions maybe?

I’ve also looked further into nodejs createServer options, but it’s really the client that you’d think needs to know about my CertAuth. https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:10

github_iconTop GitHub Comments

11reactions
Smirowcommented, Apr 16, 2017

Maybe that is what you looking for ? let client = new WebSocketClient({tlsOptions: {rejectUnauthorized: false}});

2reactions
pawrcommented, Sep 23, 2020

For testing purposes (Node.js), I was able to use the following in the client script while using self-signed certificate approach: process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when connecting to a secure Socket.io connection using ...
Socket.io client API documentation suggests that the client should pass the self signed certificate in the connection request to the server:
Read more >
54: self signed certificate in certificate chain: for 3c58f906.0
The certificate chain is not complete ; one or more of the certificates is not present in the local certificate store ($DLC/certs).
Read more >
LI81727: SELF SIGNED CERTIFICATE IN CERTIFICATE ... - IBM
Configuring a new smtp server as a mail server in the cloud manager with using a TLS profile, you may get the message:...
Read more >
Self signed certificate" in Azure App Services - Microsoft Q&A
Azure App services suddenly giving this error "SSL Error: Self ... tries to connect to a remote endpoint over SSL, it is important...
Read more >
HTTP Connector | Error: self signed certificate in certificate ...
SYMPTOM. While performing the Two-way SSL request from Postman client <--> Mule application, the Postman request fails with the following error ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found