我正在尝试在两个蚊子经纪人之间架起一座桥梁。我在配置配置文件和生成所需的证书时遇到问题。
经纪人 A:在本地计算机上充当桥梁
Broker B:在AWS服务器上,常规SSL连接,仅从Broker A收集数据。
我采取的步骤:
我与经纪人 A 共享 ca.crt。
经纪商A:配置文件:
# listen to the local data I have setup (works fine)
listener 1883
connection target-broker
address 3.208.62.218:8884
bridge_cafile E:\SSL\ca.crt
topic MSUFridge/#
经纪商 B (AWS) 配置文件:
listener 8884
allow_anonymous false
certfile /etc/mosquitto/certs/server.crt
keyfile /etc/mosquitto/certs/server.key
cafile /etc/mosquitto/certs/ca.crt
但这失败了,AWS 说:
New connection from 75.152.250.126:52995 on port 8884.
Sending CONNACK to MSU.target-broker (0, 5)
Client MSU.target-broker disconnected, not authorised.
P.S 我已经在AWS上生成了所有证书。但我也尝试在本地计算机上生成“服务器”文件并遇到同样的问题。
我非常感谢我能得到的任何帮助。谢谢。
问题与 SSL/TLS 无关,而是因为您尚未在 AWS 代理中配置任何用户身份验证。
listener 8884
allow_anonymous false
certfile /etc/mosquitto/certs/server.crt
keyfile /etc/mosquitto/certs/server.key
cafile /etc/mosquitto/certs/ca.crt
allow_anonymous false
表示其他代理必须提供用户名和密码,并且 AWS 代理必须拥有授权用户列表。
您应该查看 mosquitto 手册页,了解如何创建密码文件以及如何将其包含在配置中。
您还可以在本地代理上配置用于桥接的用户名。