Mqtt 固定Mosquitto Websockets
我已经在MosQuitto1.4.9中安装了一个running 我可以在1883年酒吧和酒吧 我也可以在8883上酒吧和酒吧。8883使用证书是安全的。 我也可以在8083上进行sub和pub,但只能使用ws。Wss将不连接 当我启动Mosquitto时,以下是日志中显示的内容: 1521831919:mosquitto版本1.4.9(构建日期2017-12-15 11:14:08-0500)开始运行Mqtt 固定Mosquitto Websockets,mqtt,mosquitto,Mqtt,Mosquitto,我已经在MosQuitto1.4.9中安装了一个running 我可以在1883年酒吧和酒吧 我也可以在8883上酒吧和酒吧。8883使用证书是安全的。 我也可以在8083上进行sub和pub,但只能使用ws。Wss将不连接 当我启动Mosquitto时,以下是日志中显示的内容: 1521831919:mosquitto版本1.4.9(构建日期2017-12-15 11:14:08-0500)开始运行 1521831919:Config从/etc/mosquitto/mosquitto.conf
1521831919:Config从/etc/mosquitto/mosquitto.conf加载
1521831919:正在打开端口1883上的ipv4侦听套接字。
1521831919:正在打开端口1883上的ipv6侦听套接字。
1521831919:正在打开端口8883上的ipv4侦听套接字。
1521831919:正在打开端口8883上的ipv6侦听套接字。
1521831919:打开端口8083上的WebSocket侦听套接字。
1521831919:未在中编译libuv支持
1521831919:创建Vhost“默认”端口8083,3个协议,IPv6关闭 当我尝试使用web界面()进行连接时,会收到一条消息,上面写着尝试连接时已断开连接wss://home.fqdn.com。 在日志中,我看到的唯一条目是: 1521834600:禁止使用公共卫生设施
1521834601:lws_读取:未处理状态76 当我尝试使用以下命令行连接到8083时:
mosquitto\u pub-h home.fqdn.com-t test-m“hello reach 2”-p 8083--capath/etc/ssl/certs/-u“userID”-p“passWD”
我收到这个消息错误:发生TLS错误。
我认为这是因为它来自CLI而不是WSS,因为我使用-p8883而不是-p8083时没有问题 这是我的配置文件:
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
persistence_file mosquitto.db
log_dest file /var/log/mosquitto/mosquitto.log
log_type all
websockets_log_level 1023
connection_messages true
log_timestamp true
password_file /etc/mosquitto/pwfile
acl_file /etc/mosquitto/aclfile.acl
#Internal Listener
listener 1883
allow_anonymous false
#External Listener
listener 8883
allow_anonymous false
certfile /etc/letsencrypt/live/home.fqdn.com/cert.pem
cafile /etc/letsencrypt/live/home.fqdn.com/chain.pem
keyfile /etc/letsencrypt/live/home.fqdn.com/privkey.pem
#Webhooks Listener
listener 8083
protocol websockets
http_dir /var/www/html
certfile /etc/letsencrypt/live/home.fqdn.com/cert.pem
cafile /etc/letsencrypt/live/home.fqdn.com/chain.pem
keyfile /etc/letsencrypt/live/home.fqdn.com/privkey.pem
我不明白如何与WS://连接,但不知道如何与WSS://连接。
8883侦听器将不允许不安全的连接,并且它正在使用相同的证书
当我连接到WS://时,我在日志中获得以下条目:
1521834238:从69.42.179.18 as连接的新客户端
mqtt-admin_48154a1b(c1,k60,u'userID')
Mosquitto版本1.4.9在libwebsockets中进行更改时无法正常工作 卸载了mosquitto并从开发人员存储库安装了1.4.15,现在WSS://连接功能正常