A connected device without security is a loaded gun pointed at your own network — and MQTT isn't the answer to every device-side problem either. This companion post covers the two things that turn a working prototype into shippable firmware: locking it down, and reaching beyond MQTT where it fits.
Lock it down
Mutual TLS, done right. Server-only TLS leaves devices talking to impostors. Both sides prove identity — the device verifies the server, the server verifies the device. Two field gotchas: actually validate the CA chain (skipping verification "temporarily" becomes permanent), and sync the clock first — certificates look invalid on a device that thinks it's 1970.
→ Why security matters — real attacks
→ Certificate-based auth and device tokens
Trust the code you run. Secure boot stops modified firmware from executing; signed OTA with hash verification plus automatic rollback stops a bad or malicious update from bricking the fleet. Credentials live in protected on-device storage with a provisioning flow — never as string literals in source. Assume anyone can dump your flash; design so a dump alone isn't enough.
→ The secure boot concept
→ Credential storage on the device
→ Secure OTA with signed firmware
Reach beyond MQTT
HTTP/REST for on-device APIs and cloud calls, WebSocket for local dashboards, Modbus RTU for industrial sensors on RS-485 that isn't going away, and BLE provisioning so users can configure WiFi credentials without hardcoding them.
→ HTTP and REST from the device
→ WebSocket basics for local dashboards
→ Modbus RTU for industrial devices
→ BLE provisioning of WiFi credentials
Capstone
A fully connected, secure IoT device — TLS-authenticated MQTT link to GrapesIoT, a clean topic schema, LWT-based presence detection, and offline buffering that survives a broker outage. Share your build in the lab submissions area when it's done.
Post questions here and tag with security, tls or ble. For the device-to-cloud path (networking, MQTT, patterns), see the companion post above.