When a device presents itself to a server, how does the server know who it is talking to? For months, our connected Cubes answered with a username and a password, while our own documents promised better. On 20 July 2026, we brought the implementation into line with what was written, for a first Cube.
Update of 28 November 2026.
Since 20 November, mutual TLS (the protocol that encrypts the connection, with a certificate presented on both sides) has also been used by the Cube that decides on site. In its connected profile, this Cube reaches our message broker over 4G with its own certificate, and the server derives from that certificate the topics the Cube is allowed to write to and read from. Its isolated profile still has neither modem nor network.
This Cube is built on the Walter board, whose modem cannot generate a key and lets a key written to it be read back in the clear. The article’s first design choice, a key born in the device, therefore does not hold for it. Its current certificate is a development certificate, whose key was generated on a workstation, and it will have to be revoked before any real use. We drew a rule from this: the TLS key authenticates the transport only. On top of that, every message is signed with the Cube’s identity key and encrypted for the server alone (see the article on post-quantum cryptography), so that a relay holding one of our certificates could neither read a message nor forge one.
Since 21 November, the Cube has also checked the server’s certificate more strictly: it verifies the server’s name, and no longer just the authority that signed it. The broker, however, still does not check the revocation list. What it takes to go from one Cube to a production run is covered in the article on going from prototype to production.
The problem: a secret you share is no longer quite a secret
A password is flawed from birth: two parties have to know it. The device keeps it in its memory, the server keeps a record of it in order to verify it, and it travels between the two at every connection. If the same password serves a whole fleet, opening a single device is enough to impersonate all the others, and the day it leaks, the only way to invalidate it is to reprogram every one of them.
The European standard ETSI EN 303 645, which sets a security baseline for consumer connected devices, opens its list of requirements with exactly this: no universal default passwords. Giving each device a different password is therefore the bare minimum, and that is what we were doing. Even so, the secret exists in two places, and it had to be generated somewhere before being loaded into the device.
What already exists: the certificate, and TLS in both directions
The tried and tested answer is the certificate. The device has a key pair: a private key, which it never shows, and a public key, which anyone can see. A certificate authority, that is, a third party the server trusts, signs a small document that says “this public key belongs to such-and-such a device”. That document is the certificate, whose format is described in RFC 5280.
On the web, only the server presents a certificate, and that is what puts the padlock in the browser. The TLS protocol nevertheless allows the client to present one too: this is called mutual TLS, since each side proves its identity to the other. The device transmits no secret. It merely proves, through a computation, that it holds the private key matching its certificate.
What we chose, and why
The starting point is a little embarrassing, so we may as well say so. Our architecture documents declared mutual TLS “mandatory”, in the present tense, while the connected Cubes were still presenting themselves with a username and a password. Our logbook for 20 July notes this gap in so many words, and the day was spent closing it.
An internal certificate authority
We set up a small internal certificate authority, with four design choices.
- The key is born in the device. The first Cube enrolled is built on an nRF9160 cellular component, and that component generates the key pair itself. All that leaves it is a certificate request, a document standardised by RFC 2986 that contains the public key. The private key therefore exists nowhere else, and there is no longer any secret in the firmware.
- The device does not choose its name. The name written in the certificate is imposed by the signer, and never read from the request. A Cube therefore cannot politely ask for its neighbour’s identity.
- A Cube’s certificate only serves to identify that Cube. It cannot be used to act as the server, or to sign other certificates.
- A single authority for the device link. The certificate the server presents to the Cubes comes from the same internal authority. The web console keeps a certificate from Let’s Encrypt (in French), because a browser must recognise it without configuration. A Cube, on the other hand, needs to know only one authority, and our logbook notes that the link therefore no longer depends on an outside authority.
On the server side, the broker, that is, the MQTT messaging server the connected Cubes talk to, now requires a certificate on the entry point reserved for devices. We checked it the same day: the broker refuses a connection without a certificate, and one with a password too. Mosquitto, our broker, can take the name written in the certificate as the client’s identity, so that each Cube’s access rights follow from its certificate rather than from what it claims.
What we gain
The first benefit is that there is nothing left to steal in the software. The firmware can be read, copied or published without weakening a single Cube, since what identifies each device stays in its component.
The second is the ability to remove a single device. A certificate can be revoked, meaning the authority declares that it no longer recognises it, either through a revocation list, described in RFC 5280, or through an online query, the OCSP protocol. A lost or replaced Cube can then stop being recognised, without the others noticing a thing. On the very first day, we revoked a test certificate generated on a workstation and replaced it with the one whose key was born in the component. One caveat: our broker does not yet check the revocation list, so today what actually shuts a Cube out is the removal of its access rule.
We also learnt a lesson in method, at the cost of a scare. While checking the access rights, we first concluded that they did nothing, since a Cube seemed able to publish where it had no right to. That was wrong. Our broker silently drops a publish it does not allow, and the client believes it succeeded. So the only test worth running is to look at what actually reaches a subscriber. Our logbook sums it up like this: “authorisation is observed at delivery”.
What it costs
A certificate authority is not something you install once and for all: it has to be run. Certificates have a limited lifetime, so they must be renewed. Enrolment takes a manual step per device, where a password could be copied in one line. The authority’s keys are worth more than all the passwords they replace, and protecting them becomes a job in its own right.
We could have kept one password per Cube, which is simple and which everyone understands, or handed issuance to a public authority. The first route left a secret in every firmware image. The second is a poor fit for devices that only talk to our server, and that have no reason to trust hundreds of authorities when one is enough.
Where we stand.
Mutual TLS is in service, and so far it covers a single connected Cube. The word “mandatory” in our documents is therefore accurate for the device entry point on our broker, but it does not describe a fleet. The Cube that decides on site and without a network, which we present in another article, does not talk to the broker and is not affected: its identity rests on another mechanism, described in the article on Bluetooth. As for operating the authority over time, with renewal, revocation at fleet scale and the protection of its keys, we have not yet put it to the test: no certificate has had to be renewed, and the broker does not yet check the revocation list. It is a demonstrator, and we have some way to go before saying more.
Sources
- ETSI, EN 303 645 v2.1.1: security baseline for consumer connected devices, including provision 5.1 on passwords.
- RFC 5280, format of X.509 certificates and revocation lists.
- RFC 8446, the TLS 1.3 protocol, including client authentication by certificate.
- RFC 2986, format of certificate requests.
- RFC 6960, the OCSP protocol for querying the status of a certificate.
- Eclipse Mosquitto, configuration man page: requiring a client certificate and deriving the identity from the certificate.
- Nordic Semiconductor, nRF9160, the cellular component of the first Cube enrolled.
- Let’s Encrypt (in French), the public certificate authority kept for the web console.
A question, an objection? contact@ops-devices.eu, or on Bluesky.