Security

MQTT that is secure by default

Encryption, authentication, access control and isolation are part of every ConnectMQ broker — the layers you would otherwise have to build into a self-hosted broker yourself.

No card required

Encryption in transit

Connect over MQTT/TLS (port 8883) or secure WebSockets (port 8084) so credentials and payloads are never sent in clear text.

Authentication

Every client identifies itself with a username and password. Give each device or service its own credentials so you can revoke one without touching the rest.

Per-topic access control

Grant publish and subscribe rights per topic. A sensor can write its own telemetry without being able to read anyone else’s.

Isolation

Your broker is a private instance. Unlike public test brokers, no other tenant can subscribe to your topics.

Access control

Give every client exactly the topics it needs

Design your topic tree around devices and directions — telemetry up, commands down — and grant each credential only its own branch. A compromised device can then only affect itself.

permissions
# Example permissions
sensor-17   publish    devices/sensor-17/telemetry
sensor-17   subscribe  devices/sensor-17/commands
dashboard   subscribe  devices/+/telemetry
backend     publish    devices/+/commands
Checklist

Production security checklist

PracticeWhy
Use TLS or WSS for every production clientPlain TCP (1883) and ws (8083) are for local tests only.
One credential per device or serviceRevoke a single client without rotating the whole fleet.
Least-privilege topicsDevices write to their own topic branch and read only their command topic.
Never put secrets in topic names or client IDsThey appear in logs and dashboards.
Keep test traffic off public brokersAnyone can read topics on public sandboxes.

Security FAQ

Is MQTT traffic to ConnectMQ encrypted?

Yes, when you connect with TLS (mqtts, port 8883) or secure WebSockets (wss, port 8084). The plain TCP and WebSocket ports exist for quick tests and environments that cannot use TLS.

Can I restrict what each device can do?

Yes. ConnectMQ supports per-topic access control, so you can allow a device to publish to its telemetry topic and subscribe to its command topic — and nothing else.

Why not just use a free public MQTT broker?

Public brokers have no authentication and no isolation: anyone can subscribe to your topics or publish fake data. They are fine for learning, not for real devices.

Get a private, secured MQTT broker

Create an account, get your broker credentials and connect your first device — no servers to install, patch or scale.

ESP32 Certificate Pinning and CA Validation for MQTT

Three ways to validate a broker certificate on an ESP32: embed a root CA, use the ESP-IDF certificate bundle, or pin. Learn the trade-offs and get working MQTT code for each.

7 min read