Giter VIP home page Giter VIP logo

Comments (1)

crackwitz avatar crackwitz commented on August 10, 2024

Nevermind that error. I'll quickly describe how to get rid of that, then close this bug.

I followed outdated advice regarding the generation of keys and cert files. tl;dr:

openssl genpkey -algorithm RSA -out ca.key -aes256
-> ca.key

openssl req -x509 -new -nodes -key ca.key -sha256 -days 400 -out ca.crt
-> ca.crt

openssl genpkey -algorithm RSA -out server.key
openssl genpkey -algorithm RSA -out client.key
-> server.key
-> client.key

openssl req -new -key server.key -out server.csr
openssl req -new -key client.key -out client.csr
-> server.csr
-> client.csr

openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 400 -sha256
openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days 400 -sha256
-> server.crt
-> client.crt

and then in mosquitto.conf:

cafile ca.crt
certfile server.crt
keyfile server.key
require_certificate true

And the client needs a few switches to know the CA, its own cert and key:

mosquitto_sub -h localhost -p 8883 -v -t \# -i some_client --cafile ca.crt --cert client.crt --key client.key 
mosquitto_pub -h localhost -p 8883 -t test/test -m test --cafile ca.crt --cert client.crt --key client.key

from mqtt-explorer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.