Just a little guide on how to set up a local Mosquitto with ssl (self-signed certificate) and web sockets.
Also you can find useful this article How to connect Mosquitto MQTT Bridge to flespi?
Generate self signed certificate:
openssl genrsa -des3 -out ca.key 2048
openssl req -new -x509 -days 1826 -key ca.key -out ca.crt
openssl genrsa -out server.key 2048
openssl req -new -out server.csr -key server.key
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 360
Mosquitto configuration (mosquitto.conf):
listener 8880
protocol mqtt
listener 8881
protocol websockets
cafile ca.crt
certfile server.crt
keyfile server.key
tls_version tlsv1
socket_domain ipv4
#require_certificate false
allow_anonymous true
Start mosquitto:
mosquitto -v -c ./mosquitto.conf
Also you can use our public MQTT Broker: https://flespi.com/mqtt-broker#mqtt-config