Skip to content

Commit 48a4f99

Browse files
committed
Fix cafile error
1 parent c7fe384 commit 48a4f99

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

articles/iot-operations/manage-mqtt-broker/howto-configure-authentication.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,9 @@ mosquitto_pub -q 1 -t hello -d -V mqttv5 -m world -i thermostat \
490490

491491
In the example:
492492

493-
- The `--cert` parameter specifies the client certificate PEM file.
493+
- The `--cert` parameter specifies the client certificate PEM file. This file should also include any intermediate certificates to help the MQTT broker build the complete certificate chain.
494494
- The `--key` parameter specifies the client private key PEM file.
495-
- The third parameter `--cafile` is the most complex: the trusted certificate database, used for two purposes:
496-
- When mosquitto client connects to MQTT broker over TLS, it validates the server certificate. It searches for root certificates in the database to create a trusted chain to the server certificate. Because of this, the server root certificate needs to be copied into this file.
497-
- When the MQTT broker requests a client certificate from mosquitto client, it also requires a valid certificate chain to send to the server. The `--cert` parameter tells mosquitto which certificate to send, but it's not enough. MQTT broker can't verify this certificate alone because it also needs the intermediate certificate. Mosquitto uses the database file to build the necessary certificate chain. To support this, the `cafile` must contain both the intermediate and root certificates.
495+
- The `--cafile` parameter is for server validation. It contains the server root certificate for the MQTT broker, which the mosquitto client uses to validate the server certificate when connecting over TLS.
498496

499497
### Understand MQTT broker X.509 client authentication flow
500498

0 commit comments

Comments
 (0)