I double checked that the certificates were correct, I re-read the documentation to make sure that what I’ve made was correct, and I checked on losant’s forum to see if anybody was having the same problem as me, but to no avail.
Here’s some example commands for AWS I found from this Github repo.
The Mosquitto Pub CLI
$ mosquitto_pub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/thing' -m "Hello from Mosquitto"
The Mosquitto Sub CLI
$ mosquitto_sub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/+'
There’s a fair amount of online resources available around connecting these tools to AWS as well to help debug. For example, here’s a Stack Overflow article I found that also shows example usage.