Skip to content

Commit 399499d

Browse files
committed
add mtls docs
Signed-off-by: Musilah <nataleigh.nk@gmail.com>
1 parent 2217949 commit 399499d

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

docs/messaging.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ to every command.
3939

4040
## CoAP
4141

42-
CoAP adapter implements CoAP protocol using underlying UDP and according to [RFC 7252][rfc7252]. To send and receive messages over CoAP, you can use [CoAP CLI][coap-cli]. To set the add-on, please follow the installation instructions provided [here][coap-cli].
42+
CoAP adapter implements CoAP protocol using underlying UDP and according to [RFC 7252][rfc7252]. To send and receive messages over CoAP, you can use [CoAP CLI][coap-cli]. To set the add-on, please follow the installation instructions provided [in this section][coap-cli].
4343

4444
Examples:
4545

@@ -250,6 +250,45 @@ client = new Paho.MQTT.Client(loc.hostname, Number(loc.port), "clientId");
250250
client.connect({ onSuccess: onConnect });
251251
```
252252

253+
## mTLS Messaging
254+
255+
SuperMQ supports mutual TLS (mTLS) to enhance security by requiring both clients and servers to authenticate each other using certificates.
256+
This ensures that only authorized clients can connect and communicate with the server.
257+
It is designed to handle high-throughput environments.
258+
Core components are modular, making it easy to plug in custom modules or replace existing ones. Extendable to add new IoT protocols, middleware, and features as needed.
259+
260+
### Certificate Setup
261+
262+
To enable mTLS, you'll need the following certificates:
263+
264+
- **CA Certificate (`ca.crt`)**: The Certificate Authority's certificate used to sign both server and client certificates.
265+
- **Server Certificate (`server.crt`) and Private Key (`server.key`)**: Used by the server to authenticate itself to clients.
266+
- **Client Certificate (`client.crt`) and Private Key (`client.key`)**: Used by the client to authenticate itself to the server.
267+
268+
Ensure that these certificates are properly generated and signed by a trusted CA.
269+
270+
### HTTP with mTLS
271+
272+
We currently use _HTTP_ without mTLS support.
273+
274+
```bash
275+
curl -sSiX POST "${protocol}://${host}:${port}/${path}" -H "content-type:${content}" -H "Authorization:TOKEN" -d "${message}"
276+
```
277+
278+
But with mTLS, clients must present their certificate during the TLS handshake.
279+
280+
```bash
281+
curl -sSiX POST "${protocol}://${host}:${port}/${path}" -H "content-type:${content}" -H "Authorization:TOKEN" -d "${message}" --cacert $cafile --cert $certfile --key $keyfile
282+
```
283+
284+
### HTTP with TLS
285+
286+
A user can also send messages with just the TLS support and just a CAA certificate using the command:
287+
288+
```bash
289+
curl -sSiX POST "${protocol}://${host}:${port}/${path}" -H "content-type:${content}" -H "Authorization:TOKEN" -d "${message}" --cacert $cafile
290+
```
291+
253292
## Subtopics
254293

255294
In order to use subtopics and give more meaning to your pub/sub channel, you can simply add any suffix to base `/m/<domain_id>/c/<channel_id>` topic.

0 commit comments

Comments
 (0)