Home > database >  How to connect to MQTT broker in TLS in brower (React, Vue)
How to connect to MQTT broker in TLS in brower (React, Vue)

Time:11-03

I want to set a mqtt TLS connection in frontend (react)

If i cannot access file system in browser, how can i read ca files in react app?

Or is it required to set up a server for mqtt tls communication and request to it from the frontend?

CodePudding user response:

In the browser you have to use the browser's built in certificate store.

If you want to use a custom CA then it will need to be imported and trusted before you visit the page manually by the user (or possibly by an it administrator in a enterprise managed environment). You can not do this from within the app/web page.

The other option is to make sure that the certificate you use for the broker is issued by one of the trusted public CAs already included in the browser

  • Related