我们在HTTPS服务器中遇到MQTT连接问题。有时它工作正常,有时候会出现如下错误。
与'wss:// MYHOST:8083 / mqtt'的WebSocket连接失败:连接建立错误:net :: ERR_INSECURE_RESPONSE
pid_file /var/run/mosquitto.pid
听众8083
坚持真实的 persistence_location / var / lib / mosquitto /
log_dest文件/var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
听众1883年
协议websockets
certfile /etc/mosquitto/certs/myhost.crt
cafile /etc/mosquitto/certs/ca.crt
keyfile /etc/mosquitto/certs/myhost.key
host ='MYHOST'; //主机名或IP地址
port = 8083;
topic ='TOPIC'; //订阅的主题
useTLS = true;
username =“”;
密码=“”;
path =“/ mqtt”;
cleansession = true;
感谢。