Error Messages:
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
Solution:
Add an option: –insecure
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
Reference:
https://community.home-assistant.io/t/mqtt-host-name-verification-failure-ssl/337356