Support TLS client config NodeJS: TLS client certificates etc
See original GitHub issueHello 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:
- Created 8 years ago
- Comments:12 (5 by maintainers)
Top GitHub Comments
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.