Establishing an SSL encrypted MQTT connection between a Mongoose OS powered device and Mosquitto - SugarFreeOrbit/MosquittoMQTT GitHub Wiki
- Generate CA, server and a client certificate using generate-CA.sh
- Install Mosquitto
- Add the following parameters to your mosquitto configuration file:
require_certificates true
cafile PATH_TO_YOUR_CAFILE
certfile PATH_TO_YOUR_SERVER_CERTIFICATE
keyfile PATH_TO_YOUR_CLIENT_CERTIFICATE
port 8883
- Launch Mosquitto with the modified configuration file
- Upload your CA and client certificate to ESP8266 using the following command
mos put PATH_TO_YOUR_CERTIFICATE
- Make the following changes to your Mongoose OS MQTT configuration:
"mqtt": {
"enable": true,
"server": "YOUR_IP:8883",
"ssl_cert": "YOUR_CLIENT_CERTIFICATE.crt",
"ssl_key": "YOUR_CLIENT_KEY.key",
"ssl_ca_cert": "YOUR_CA_CERTIFICATE.crt",