I implement mqtt using HiveMQ in flutter mobile application. But when I tried to run in flutter web it shows “Unsupported operation: default SecurityContext getter”.I used “mqtt_client: ^10.0.0” package.
I saw that " browser client supports only secure(wss) and non-secure(ws) websocket connections.".But from where i get this wss for mqtt connection using hive.
Could you please confirm if this is a HiveMQ Cloud broker, or a self-managed broker that we are looking to connect to? If using a HiveMQ Cloud broker, it is important to keep in mind that TLS/SSL connections are required, and it does not appear that we are providing a certificate here for the connecting client.
Are you able to successfully connect to the broker from a test client, such as the MQTT CLI tool, or the Web Client?
Additionally, our HiveMQ Cloud server certificate can be obtained from our Frequently Asked Questions section here on the community forum.
Hi, Thís is a HiveMQ Cloud broker.
I am developing application using flutter. So in mobile mqtt is working fine issue is only when a run in web.
I gave Free URL and port 8883.It is working fine in mobile application. I saw that in browser we need to pass ws URL. So from where we get that?
Hi @Daria_H ,
Thanks for the response.
But I tried this way with same url but when i am trying to connect I got “MqttBrowserWsConnection::connect - The URI supplied for the WS has an incorrect scheme”
Could you please provide the whole connect string that is currently being used for this connection attempt? Some libraries require an additional identifier prepended to provided URL, defining HTTP, HTTPS, or WS (websocket) connections.