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.

Support TLS client config NodeJS: TLS client certificates etc

See original GitHub issue

Hello I’m using autobahn in my enterprise application which all communications use a two way hand shaking. So we have certificates in the Server and In the Client as well.

I was having some problems when using HTTPS/WSS with autobahn as we could not tell it to use the certificates for the websockets.

So I looked at the code and realized that in the https://github.com/crossbario/autobahn-js/blob/master/package/lib/transport/websocket.js#L80 in the instantiation of the WebSocket only the protocols as the parameter are used and there’s no way to use other options along with it.

If the options in the transports were passed through the WebSocket itself this would solve this problem and provide more customization to the transports.

Usage Example:

let conn = new autobahn.Connection({
  realm: theREALM,
  transports : [{
    type: 'websocket', 
    url: 'wss://localhost:1339',
    options: {
      key: THE_KEY,
      cert: THE_CERT,
      rejectUnauthorized: true,
      requestCert: ...
      ...
    }
  }]
});

What do you think? I’ve a patch with this change that I can contribute if it’s relevant.

Best Regards.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
photonbitcommented, Feb 18, 2016

I had this issue too. As ws is using nodejs https as agent for secure connections, you can solve this by overriding https.globalAgent before openning the autobahn connection.

0reactions
oberstetcommented, Dec 29, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

TLS (SSL) | Node.js v19.3.0 Documentation
With TLS/SSL, all servers (and some clients) must have a certificate. Certificates are public keys that correspond to a private key, and that...
Read more >
Configuring Your Node.js Server for Mutual TLS - Smallstep
How to use TLS, client authentication, and CA certificates in Node.js. Create a private key and request a certificate for your Node.js server....
Read more >
Client and server SSL mutual authentication with NodeJs
Brief how-to on how to create an SSL mutual authenticated communication between client and server in Nodejs.
Read more >
Use SSL Client Authentication with node.js and Express
Use SSL Client Authentication with node.js and Express · Create a signing key (CA) · Create a signed certificate · Set up https...
Read more >
HTTP request with client certificate in Node.js - SAP Blogs
The server which receives our HTTP request is the XSUAA service. The HTTP request we're sending is used to fetch a token. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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