增加一个选项即可解决:--insecure
出问题:
mosquitto_pub -d -h 192.168.1.10 -p 1883 -t hello -m 123 --cafile ~/cacert.pem
Client null sending CONNECT
Error: host name verification failed.
OpenSSL Error[0]: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Error: Protocol error
解决:
mosquitto_pub -d -h 192.168.1.10 -p 1883 -t hello -m 123 --cafile ~/cacert.pem --insecure
Client null sending CONNECT
Client null received CONNACK (0)
Client null sending PUBLISH (d0, q0, r0, m1, 'hello', ... (3 bytes))
Client null sending DISCONNECT
参考:https://community.home-assistant.io/t/mqtt-host-name-verification-failure-ssl/337356
解决MQTT SSL证书验证失败的问题
博客内容讲述了在使用mosquitto_pub命令时遇到的SSL证书验证失败问题,通过添加--insecure选项成功解决。该选项允许客户端不进行主机名验证,从而能够连接到MQTT服务器。
847

被折叠的 条评论
为什么被折叠?



