4
Step 3. Generate the TLS Certificate and Key for the LoRa Application Server (AS)
./generate_CA.sh client loraappserver
Step 4. Generate the TLS Certificate and Key for the Client (Gateway)
Note: Replace xxxxxxxxxxxxxxxx with your LoRa Gateway EUI
./generate_CA.sh client eui_xxxxxxxxxxxxxxxx
2.2 Configure Mosquitto
Step 1. Copy the CA Certificate and the Server Certificate and Key to the directory
/etc/mosquitto/certs
Sudo cp ~/ca.* server.* /etc/mosquitto/certs
Step 2. Edit
/etc/mosquitto/mosquitto.conf
adding the following code:
port 8883
cafile /etc/mosquitto/certs/ca.crt
certfile /etc/mosquitto/certs/server.crt
keyfile /etc/mosquitto/certs/server.key
require_certificate true
tls_version tlsv1
Step 3. Restart the mosquitto service
systemctl restart mosquitto
2.3 Configure LoRa Server
Step 1. Copy the CA Certificateand Key for the loraserver to
/etc/loraserver
cp ~/loraserver.* /etc/loraserver
cp ~/ca.crt /etc/loraserver
Step 2.
Edit the file
network_server.gateway.backend
located in
/etc/loraserver/loraserver.toml