Skip to content

sonnyyu/mtls-mosquitto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 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-mosquitto/certs
cd ~/mtls-cert-manage/pki/clientcerts
cp * ~/mtls-mosquitto/certs

Getting started mosquitto with certificate

cd ~/mtls-mosquitto
docker-compose build

Getting started mosquitto with certificate

docker-compose up -d

Quit

docker-compose down 

Quit and remove Volume

docker-compose down -v

Test mTLS

cd ~/mtls-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"