Skip to content

Use mTLS authentication at Eclipse Mosquitto An open source MQTT broker

License

Notifications You must be signed in to change notification settings

sonnyyu/mtls-eclipse-mosquitto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use mtls-cert-manage generate server/client/ca certificate

https://github.com/sonnyyu/mtls-cert-manage

Copy Certificate from mtls-cert-manage

cd ~/mtls-cert-manage/pki
./server.sh
./client.sh

Copy Certificate from mtls-cert-manage

cd ~/mtls-cert-manage/pki/servercerts 
cp * ~/mtls-eclipse-mosquitto/certs
cd ~/mtls-cert-manage/pki/clientcerts
cp * ~/mtls-eclipse-mosquitto/certs

Getting started mosquitto with certificate

cd ~/mtls-eclipse-mosquitto
docker-compose up -d

Quit

docker-compose down 

Quit and remove Volume

docker-compose down -v

Test mTLS

sudo apt  install mosquitto-clients -y
cd ~/mtls-eclipse-mosquitto/certs/
mosquitto_sub -p 8883 --cafile ca.crt --cert client1.crt --key client1.key -h 192.168.1.204 -t msg 
# Start a an other SSH session from the command line
mosquitto_pub -p 8883 --cafile ca.crt --cert client1.crt --key client1.key -h 192.168.1.204 -t msg -m "test"