shamblett / mqtt5_client

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

Exceeding password and username #60

Closed MichalNemec closed 11 months ago

MichalNemec commented 11 months ago

Hello, im trying to connect to EMQX using JWT.

MQTT explorer app logs in no problem with tls on username email and password JWT

Authenticating with username '{email}' and password '{JWT}'
MqttClient::checkCredentials - Username length (23) exceeds the max recommended in the MQTT spec.
-- MqttClient::checkCredentials - Password length (1837) exceeds the max recommended in the MQTT spec.
-- MqttConnectionHandlerBase::connect - server mqtt://mqtt.mydomain.com, port 8883
-- MqttSynchronousServerConnectionHandler::internalConnect entered
-- MqttSynchronousServerConnectionHandler::internalConnect - initiating connection try 0, auto reconnect in progress false
-- MqttSynchronousServerConnectionHandler::internalConnect - insecure TCP selected
-- MqttSynchronousServerConnectionHandler::internalConnect - calling connect
-- MqttNormalConnection::connect- entered
-- MqttConnectionBase::_onError - calling disconnected callback
ERROR: SocketException: Connection refused (OS Error: Connection refused, errno = 61), address = mqtt://mqtt.mydomain.com, port = 56837

How to deal with this?

shamblett commented 11 months ago

Whatever your problem is its not the length of your username or password, these are effectively set by what the broker will accept. The log lines are simply warnings that the exceed the lengths stated in the spec.

shamblett commented 11 months ago

Your error seems to be 'connection refused' please check your network parameters, ports etc.

MichalNemec commented 11 months ago

got it working now, wrong port, now its working, thank you!