我正在尝试在我的 Raspberry Pi 3 上使用 SSL 设置 Mosquitto。我遵循了本教程
现在我的 mosquitto.conf 是:
listener 8883
cafile /etc/mosquitto/certs/mosq-ca.crt
certfile /etc/mosquitto/certs/mosq-serv.crt
keyfile /etc/mosquitto/certs/mosq-serv.key
但是当我运行推荐时:
mosquitto_sub -t "#" -v --cafile /etc/mosquitto/certs/mosq-ca.crt -p 8883
我得到:
Error: connection refused
我已经删除了/etc/mosquitto/conf.d/mosquitto.conf
。该文件现在是空的。现在默认的 mosquitto.conf 是:
pid_file /var/run/mosquitto.pid
persistence true persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
listener 8883
cafile /etc/mosquitto/certs/mosq-ca.crt
certfile /etc/mosquitto/certs/mosq-serv.crt
keyfile /etc/mosquitto/certs/mosq-serv.key
但我还是收到
Error: connection refused
我做错了什么或我忘记做什么?
当我使用时(我不会监听端口 8883)sudo mosquitto -v
:
1514921332: mosquitto version 1.4.10 (build date Mon, 29 May 2017 13:43:29 +0100) starting
1514921332: Using default config.
1514921332: Opening ipv4 listen socket on port 1883.
1514921332: Opening ipv6 listen socket on port 1883.
我的/var/log/mosquitto/mosquitto.log
日志:
1514932164: Config loaded from /etc/mosquitto/mosquitto.conf.
1514932164: Opening ipv4 listen socket on port 8883.
1514932164: Opening ipv6 listen socket on port 8883.
1514932373: Error in poll: Interrupted system call.
1514932373: mosquitto version 1.4.10 terminating
1514932378: mosquitto version 1.4.10 (build date Mon, 29 May 2017 13:43:29 +010$
错误已经感谢: Error: A TLS error occurred.