Skip to content

Commit 97b800e

Browse files
Update MQTT broker setup steps (FreeRTOS#1215)
* Update MQTT broker setup in FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/mqtt_broker_setup.txt * Minor fix --------- Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
1 parent 24ad46b commit 97b800e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

FreeRTOS-Plus/Demo/coreMQTT_Windows_Simulator/MQTT_Multitask/mqtt_broker_setup.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ TLS mutual authentication for use with this MQTT demo.
44
a. Download and install [Git For Windows](https://git-scm.com/download/win).
55
Most of you may already have this installed. Git For Windows provides an
66
OpenSSL binary for generating certificates.
7-
b. Open PowerShell and enter the following commands to generate TLS certificates:
7+
b. Open PowerShell and enter the following commands to generate TLS certificates [Note: While creating the certificates make sure to not use same organization name for all the certificates to prevent "self-signed certificate" error.]:
88
i. cd "C:\Program Files\Git\usr\bin" # If Git is installed elsewhere, update the path.
99
ii. mkdir $home\Documents\certs
1010
iii. .\openssl.exe req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout $home\Documents\certs\ca.key -out $home\Documents\certs\ca.crt
@@ -13,16 +13,19 @@ TLS mutual authentication for use with this MQTT demo.
1313
vi. .\openssl.exe genrsa -out $home\Documents\certs\client.key 2048
1414
vii. .\openssl.exe req -new -out $home\Documents\certs\client.csr -key $home\Documents\certs\client.key
1515
viii. .\openssl.exe x509 -req -in $home\Documents\certs\client.csr -CA $home\Documents\certs\ca.crt -CAkey $home\Documents\certs\ca.key -CAcreateserial -out $home\Documents\certs\client.crt -days 365
16+
ix. [Optional] .\openssl.exe verify -CAfile $home\Documents\certs\ca.crt $home\Documents\certs\server.crt # verify the server certificate is correctly signed
17+
x. [Optional] .\openssl.exe verify -CAfile $home\Documents\certs\ca.crt $home\Documents\certs\client.crt # verify the client certificate is correctly signed
1618
2. Download Mosquitto from https://mosquitto.org/download/
1719
3. Install Mosquitto as a Windows service by running the installer.
1820
4. Go to the path where Mosquitto was installed. The default path is C:\Program Files\mosquitto.
19-
5. Update mosquitto.conf to have the following entries and don't forget to substitute your Windows username:
20-
port 8883
21+
5. Update mosquitto.conf to have the following entries and don't forget to substitute your Windows username [Mosquitto Version 2.0.0 onwards]:
22+
listener 8883
2123
cafile C:\Users\%Substitute Windows username%\Documents\certs\ca.crt
2224
certfile C:\Users\%Substitute Windows username%\Documents\certs\server.crt
2325
keyfile C:\Users\%Substitute Windows username%\Documents\certs\server.key
2426
require_certificate true
2527
tls_version tlsv1.2
28+
allow_anonymous true
2629
6. Start the Mosquitto service.
2730
More details about running Mosquitto as a Windows service can be found at
2831
https://github.com/eclipse/mosquitto/blob/master/readme-windows.txt and

0 commit comments

Comments
 (0)