Table of Contents

MQTT Server für owntracks

Installation

Eigene CA

  1. ./easyrsa init-pki
  2. ./easyrsa build-ca
  3. ./easyrsa build-server-full brot-mqtt nopass
  4. ./easyrsa build-client-full brot-owntracks
    1. passwort ist bei owntracks pflicht
  5. cp pki/issued/brot-mqtt.crt pki/private/brot-mqtt.key pki/ca.crt ~/docker-mosquitto/
  6. 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

mosquitto MQTT brocker im Docker-Container

  1. mkdir ~/docker-mosquitto
  2. nano ~/docker-mosquitto/mosquitto.conf
  3. mkdir ~/docker-mosquitto/data ~/docker-mosquitto/log
  4. 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