emqx / MQTTX

A Powerful and All-in-One MQTT 5.0 client toolbox for Desktop, CLI and WebSocket.
https://mqttx.app
Apache License 2.0
3.95k stars 450 forks source link

[Bug] Empty user names cannot establish TLS connections #890

Open GunnarMorrigan opened 2 years ago

GunnarMorrigan commented 2 years ago

What did I do

Apply an empty username before connecting.

What happened

MQTTx keeps loading without result. While it works if you enter 1 or more characters.

Missing log file can delay the handling of the issue.

Expected

Expected to replace the empty username of the client with the cn name within the cert.

Environment

More detail

Broker and client with two way TLS (https://www.emqx.com/en/blog/enable-two-way-ssl-for-emqx) Start the broker with allow_anonymous = false. Have mnesia with username client and password client. Try to sign in with no username and password client.

Docker, self signed certs with common name "client"

For EMQ X 4.3 or newer, please provide the log archive generated by node_dump tool Not sure how to easily do this on the docker container.

EMQ X version (e.g. emqx_ctl status): 4.3.8
Hardware configuration (e.g. lscpu): docker
OS (e.g. cat /etc/os-release): Alpine Linux
Kernel (e.g. uname -a): Linux 997a7b9f72f3 5.10.16.3-microsoft-standard-WSL2

Issue created on EMQx: https://github.com/emqx/emqx/issues/6885 Was found to be issue with MQTTx

ysfscream commented 2 years ago

Hi, @gunnarpieter thanks for using EMQX and MQTTX!

Perhaps some errors caused MQTTX did not catch up, so there has been no results, but I did not have a good reproduction, perhaps you can upgrade MQTTX to the latest version https://github.com/emqx/MQTTX/releases/tag/v1.7.2 to try, in the middle we have fixed some problems about TLS authentication, but because your version is older, upgrade will have data loss, please do a backup in advance.