Establishing an SSL encrypted MQTT connection between a Mongoose OS powered device and Mosquitto - SugarFreeOrbit/MosquittoMQTT GitHub Wiki

  1. Generate CA, server and a client certificate using generate-CA.sh
  2. Install Mosquitto
  3. 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
  1. Launch Mosquitto with the modified configuration file
  2. Upload your CA and client certificate to ESP8266 using the following command mos put PATH_TO_YOUR_CERTIFICATE
  3. 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",