shamblett / mqtt_client

A server and browser based MQTT client for dart
Other
548 stars 176 forks source link

Does the package has support connect MQTT using Username, Password, and TLS-PSK? #310

Closed wickyou23 closed 3 years ago

wickyou23 commented 3 years ago

Currently, My company's device using the mosquitto for brokers and verify clients by Username, Password, and PSK. I don’t know how to connect to a broker using PSK in Dart? Does the package has support for the case?

shamblett commented 3 years ago

The client supports secure sockets(TLS) if you are on the server side, see the mqtt_server_client_secure.dart example in the examples directory. You can pass a username and password in the connect method, this will be sent to the broker in the connect message. This client is for MQTT 3 and 3.1, if you need more specialist authentication MQTT5 may be a better choice, see the mqtt5_client package.

thangphungverik commented 3 years ago

Hello @shamblett

Thanks for your support. I am working on the mobile using flutter. Your package supported TLS for the CA files, but with TLS-PSK I didn't found. You can refer to this link for my case.

https://mosquitto.org/man/mosquitto_sub-1.html

shamblett commented 3 years ago

This has nothing to do with the client, the client uses the Dart runtime security context here, you can only do what the runtime supports here, this would be the same with the mqtt5_client.

wickyou23 commented 3 years ago

Thanks @shamblett, I had clarified my case. I will close the thread.