Add labs
This commit is contained in:
39
04-mosquitto/lab07/lab.txt
Normal file
39
04-mosquitto/lab07/lab.txt
Normal file
@ -0,0 +1,39 @@
|
||||
= Verwendung TLS PSK
|
||||
|
||||
|
||||
Erstellen Sie eine Datei für `psk_file`.
|
||||
Zufallsschlüssel können mit `openssl rand -hex 16` generiert werden.
|
||||
|
||||
Client_123:d91bc336c989761cf44d703e694acf59
|
||||
thomas:cc53e7fda42c3f7ddc4a9cea6e9b33de
|
||||
|
||||
Konfigurieren Sie einen zusätzlichen Listener auf Port `8883` für TLS-PSK
|
||||
|
||||
|
||||
listener 8883
|
||||
listener_allow_anonymous true # Anonym trotz PSK!
|
||||
|
||||
psk_file /mosquitto/config/tls-psk.txt
|
||||
psk_hint mosquitto-psk
|
||||
|
||||
|
||||
$ docker run --rm -it --init --net host -v $PWD/config:/mosquitto/config eclipse-mosquitto
|
||||
|
||||
|
||||
Greifen Sie mittels `mosquitto_sub` per TLS-PSK zu
|
||||
|
||||
$ docker run --rm -it --init --net host eclipse-mosquitto \
|
||||
mosquitto_sub --psk-identity thomas --psk cc53e7fda42c3f7ddc4a9cea6e9b33de \
|
||||
--qos 1 --topic user/thomas/inbox --debug
|
||||
|
||||
|
||||
|
||||
Erweitern Sie die Konfiguration mit `use_identity_as_username true`
|
||||
|
||||
|
||||
listener 8883
|
||||
use_identity_as_username true
|
||||
listener_allow_anonymous false # Jetzt ist User gemappt
|
||||
|
||||
psk_file /mosquitto/config/tls-psk.txt
|
||||
psk_hint mosquitto-psk
|
||||
Reference in New Issue
Block a user