I am trying to setup mosquitto MQTT server using TLS1.2 using lets encrypt certificates.
I have installed mosquitto and setup lets encrpypt. My /etc/mosquitto/conf.d/default.conf is
listener 1883 localhost
listener 8883
certfile /etc/letsencrypt/live/mqtt.atom.net/cert.pem
cafile /etc/letsencrypt/live/mqtt.atom.net/chain.pem
keyfile /etc/letsencrypt/live/mqtt.atom.net/privkey.pem
On the server run mosquitto I can successfully publish and subscribe to messages
Sub
mosquitto_sub -h localhost -t test
hello
Pub
mosquitto_pub -h mqtt.atom.net -t test -m "hello" -p 8883 --capath /etc/ssl/certs/
From another system on the Internet (or ESP32) - I get error when trying to establish TLS connection
mosquitto_pub -h mqtt.atom.net -t test -m "hello again" -p 8883
Error: The connection was lost.
What cafile / certs do I need to pass to the mosquitto_pub?