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