./easyrsa init-pki
./easyrsa build-ca
./easyrsa build-server-full brot-mqtt nopass
./easyrsa build-client-full brot-owntracks
passwort ist bei owntracks pflicht
cp pki/issued/brot-mqtt.crt pki/private/brot-mqtt.key pki/ca.crt ~/docker-mosquitto/
openssl pkcs12 -export -in pki/issued/brot-owntracks.crt -inkey pki/private/brot-owntracks.key -name “brot owntracks TLS Client Cert” -out brot-owntracks.p12
mkdir ~/docker-mosquitto
nano ~/docker-mosquitto/mosquitto.conf
mkdir ~/docker-mosquitto/data ~/docker-mosquitto/log
docker run -d -p 53883:8883 -name brot-mqtt -v /home/brot/docker-mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf -v /home/brot/docker-mosquitto/data/:/mosquitto/data/ -v /home/brot/docker-mosquitto/log/:/mosquitto/log/ -v /home/brot/docker-mosquitto/ca.crt:/mosquitto/ca.crt -v /home/brot/docker-mosquitto/brot-mqtt.crt:/mosquitto/brot-mqtt.crt -v /home/brot/docker-mosquitto/brot-mqtt.key:/mosquitto/brot-mqtt.key eclipse-mosquitto
listener 8883
cafile /mosquitto/ca.crt
certfile /mosquitto/brot-mqtt.crt
keyfile /mosquitto/brot-mqtt.key
require_certificate true
use_identity_as_username true
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log