shamblett / mqtt5_client

A server and browser based MQTT 5 client for dart
Other
49 stars 25 forks source link

MqttBrowserClient set certificate on wss connection #91

Closed dariowskii closed 5 months ago

dariowskii commented 5 months ago

I know I can't use SecurityContext on the web. Using a wss connection I must necessarily pass the X509 certificate and the private key.

How can I achieve this with the MqttBrowserClient class?

shamblett commented 5 months ago

You can't, the Dart API doesn't allow it, see WebSockets . You can only use ws or wss in the browser, there is no provision to supply certs and keys as you can server side.

The Dart google guys can probably give you the reason for this.

dariowskii commented 5 months ago

Doing some research I came to the same answer ☹️ Thanks for your confirmation and availability!