MOSQUITTO-TLS(7)
π MOSQUITTO-TLS π
ok bestie, welcome to the mosquitto-tls(7) glow-up β¨ this is a manual page from the Conventions and miscellaneous corner of the Mosquitto world, and it's literally all about getting SSL/TLS set up so your connections are encrypted and your clients can actually authenticate. no cap, it's giving "secure or nothing." π
πΈ NAME πΈ
mosquitto-tls β configure SSL/TLS support for Mosquitto, aka make your broker's connections encrypted and authenticated π₯
β¨ DESCRIPTION β¨
so basically mosquitto ships with SSL support for encrypted network connections and authentication, and this manual is the whole "how do I actually create the files I need" arc. main character energy from start to finish π
π¨ Note, and please actually read this one: it is important to use different certificate subject parameters for your CA, your server, and your clients. If the certificates end up looking identical β even if you generated them separately, bestie, even if you swear you did β the broker/client will not be able to tell them apart, and you'll get errors that are genuinely difficult to diagnose. like, crying-in-the-group-chat levels of confusing π
π¦ GENERATING CERTIFICATES π¦
the sections below hand you the openssl commands you can use to generate certificates, but with no context β just the raw commands, no vibes attached. if you want the full run-through of how to use them, there's an asciicast here: https://asciinema.org/a/201826 β go watch it, it's the tutorial arc π
π CERTIFICATE AUTHORITY
first up: generate a certificate authority certificate and key. this is the parent of the whole operation.
openssl req -new -x509 -days <duration> -extensions v3_ca -keyout ca.key -out ca.crt
π₯ SERVER
generate a server key:
openssl genrsa -aes256 -out server.key 2048
then generate a certificate signing request to send to the CA:
openssl req -out server.csr -key server.key -new
π Note: when it prompts you for the CN (Common Name), please enter either your server (or broker) hostname or domain name. that's the whole assignment, don't overthink it π
now send that CSR to the CA, or just sign it yourself with your CA key:
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days <duration>
π§ CLIENT
same energy, client edition. generate a client key:
openssl genrsa -aes256 -out client.key 2048
generate a certificate signing request to send to the CA:
openssl req -out client.csr -key client.key -new
send the CSR to the CA, or sign it with your CA key:
openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days <duration>
and that's the trifecta β CA, server, client β all signed and ready to slay π
β SEE ALSO β
go read these next, iykyk:
π«Ά AUTHOR π«Ά
Roger Light <roger@atchoo.org> β the icon who made all of this happen π
and that's the page, bestie π this was MOSQUITTO-TLS(7) from the Mosquitto Project, dated 02/09/2026 β go forth and encrypt, fr fr πβ¨
π¦ where this page comes from
- alpine 3.24: mosquitto-doc 2.1.2-r1 Β· EPL-1.0 OR EPL-2.0
- fedora 44: mosquitto 2.1.2-1.fc44 Β· EPL-2.0
- fedora 44: mosquitto 2.1.2-1.fc44 Β· EPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms