Tom*_*hes 5 windows authentication broker mqtt mosquitto
在 Steve Copes 的“如何在 Windows 上安装 Mosquitto Broker”之后,我创建了一个 password.txt 文件并使用 mosquiito_passwd 实用程序对其进行加密。
然后我通过取消注释allow_anonymous并设置为false来编辑mosquitto.conf文件,取消注释password_file并设置我的password.txt文件的路径(与mosquitto.conf在同一文件夹中)
使用 MQTT Explorer,我可以使用 password.txt 文件中的凭据登录代理,但我仍然可以将用户和密码留空登录。
我在这里看到了类似的问题,但我找不到任何有效的解决方案,请为我指出正确的方向。我在 Windows 10 上使用 mosquitto 2.0.14 x64
编辑:
仅对 mosquitto.conf 进行的编辑取消注释行,如下所示:
# acl_file
allow_anonymous false
# allow_zero_length_clientid
# auto_id_prefix
password_file C:\Users\'MyName'\mosquitto\password.txt
# plugin
# plugin_opt_*
# psk_file
Run Code Online (Sandbox Code Playgroud)
Tom*_*hes 11
找到的解决方案:在allow_anonymous false 之前添加“listener 1883”使其正常工作,尽管我不确定为什么会产生影响。配置文件如下:
# acl_file
listener 1883
allow_anonymous false
# allow_zero_length_clientid
# auto_id_prefix
password_file C:\Users\'MyName'\mosquitto\password.txt
# plugin
# plugin_opt_*
# psk_file
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2588 次 |
| 最近记录: |