本文介绍了Windows上的Mosquitto服务问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在对mosquitto.conf文件进行更改以添加TLS支持后,我重新启动了Mosquitto Broker服务,但未启动.该错误表明Mosquitto服务在本地计算机上启动,然后停止-

After I made changes to the mosquitto.conf file for adding TLS support, I restarted the Mosquitto Broker service but its not starting. The error says the Mosquitto Service started on Local computer and then stopped -

# MQTT over TLS
listener 8883
cafile C:Program Files (x86)mosquittocertificatesca.crt
certfile C:Program Files (x86)mosquittocertificatesserver.crt
keyfile C:Program Files (x86)mosquittocertificatesserver.key

当我对mosquitto.conf文件进行更改时,也会发生此错误-

This error also occurs when I made changes to the mosquitto.conf file-

listener 9001 0.0.0.0
protocol websockets

我正在使用Windows 10计算机.有人遇到过这个问题吗?

I am using a Windows 10 machine. Did anyone face this problem?

推荐答案

在注释中已完成

证书的路径需要包含正确的路径分隔符"\",并且由于它们包含空格,因此应使用引号引起来.例如

The paths to the certificates need to have the correct path separators '\' included and as they contain spaces should be wrapped in quotes. e.g.

# MQTT over TLS
listener 8883
cafile "C:\Program Files (x86)\mosquitto\certificates\ca.crt"
certfile "C:\Program Files (x86)\mosquitto\certificates\server.crt"
keyfile "C:\Program Files (x86)\mosquitto\certificates\server.key"

Windows的mosquitto的预构建版本也不包含websocket支持.如果需要websocket支持,则必须自己从源代码中构建它,并构建并包含libwebsocket依赖项.

Also the pre-built version of mosquitto for Windows does not include websocket support. If you need websocket support you will have to built it from the source yourself and build and include the libwebsocket dependency.

这篇关于Windows上的Mosquitto服务问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 17:32