MQTT.js icon indicating copy to clipboard operation
MQTT.js copied to clipboard

Is there support for client certificates over WSS?

Open SystemDisc opened this issue 5 years ago • 2 comments

Is there support for client certificates over WSS? If not, what would it take to get this feature added? I can try to help

AB#9531294

SystemDisc avatar Mar 15 '21 23:03 SystemDisc

I was struggling with this too, but if you dig into code you will find this bit: https://github.com/mqttjs/MQTT.js/blob/master/lib/connect/ws.js#L8

I managed to get it to work by constructing options object including following properties:

{
  cert: "<pem client certificate>",
  key: "<pem client private key>",
  rejectUnauthorized: false,
  ...
} 

You could also include them in wsOptions.

Note for maintainers - I would add some example in docs about using wss and client certificates.

zielu avatar May 26 '21 14:05 zielu

This is an automated message to let you know that this issue has gone 365 days without any activity. In order to ensure that we work on issues that still matter, this issue will be closed in 14 days.

If this issue is still important, you can simply comment with a "bump" to keep it open.

Thank you for your contribution.

github-actions[bot] avatar Sep 16 '22 02:09 github-actions[bot]

This issue was automatically closed due to inactivity.

github-actions[bot] avatar Oct 18 '22 02:10 github-actions[bot]