This guide outlines steps to secure connections between ThingsBoard and Edge instances using gRPC connections over TLS/SSL.
You can configure SSL termination in two ways: by utilizing the built-in SSL capabilities of the platform for gRPC traffic or by employing an external load balancer as the termination point.
The instructions are divided into two main parts: configuring the server side (platform) and the client side (edge).
Server SSL Configuration
Choose between the built-in mechanism or using a load balancer for SSL termination for gRPC traffic. Use the content toggle below to select and view the instructions for each option.
Follow the instructions below to generate your own certificate files. This approach is useful for testing but is time-consuming and not recommended for production environments. Generate a Private KeyGenerate a new private key using the command below. This will create a 2048-bit RSA private key and store it in a file named
Generate a Certificate Signing Request (CSR)Next, use your private key to generate a CSR.
You will need to provide details such as your organization’s name, common name (domain name), and an email address, which will be included in the certificate’s subject field.
Save the CSR as
Generate a Self-Signed CertificateFinally, create a self-signed certificate from your CSR. The following command generates a certificate named
Enable SSL Communication on the ServerFor both Ubuntu and CentOS/RHEL installations, enable SSL communication server-side with the following command:
Restart the server to apply the changes:
|
The guide recommends using HAProxy as the SSL termination point for your platform. For those utilizing Ubuntu Server, please follow these specific steps. If you’re on a CentOS/RHEL Server, adhere to these instructions. |
Configuring Edge to Use SSL Connection
Ubuntu or CentOS/RHEL
To enable SSL communication on the Edge for Ubuntu or CentOS/RHEL installations, execute the following command:
1
2
3
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf
export CLOUD_RPC_SSL_ENABLED=true
EOL'
If you are using self-signed certificates, it is necessary to add the server-side public certificate to the Edge’s configuration to verify the server’s certificate:
1
2
3
sudo sh -c 'cat <<EOL >> /etc/tb-edge/conf/tb-edge.conf
export CLOUD_RPC_SSL_CERT=certFile.crt
EOL'
To apply these changes, restart the Edge:
1
sudo systemctl restart tb-edge
Docker
In Docker setups, make sure the CLOUD_RPC_SSL_ENABLED variable in the docker-compose.yml
file is set to ‘true’.
If using self-signed certificates, also set CLOUD_RPC_SSL_CERT accordingly.
After making these changes, restart the ThingsBoard Edge docker container with the command:
1
docker compose restart mytbedge
Next Steps
-
Getting started guide - Provide quick overview of main ThingsBoard Edge features. Designed to be completed in 15-30 minutes:
-
Installation guides - Learn how to setup ThingsBoard Edge on various available operating systems and connect to ThingsBoard CE server.
-
Edge Rule Engine:
-
Rule Chain Templates - Learn how to use ThingsBoard Edge Rule Chain Templates.
-
Provision Rule Chains from cloud to edge - Learn how to provision edge rule chains from cloud to edge.
-
-
Features:
-
Edge Status - Learn about Edge Status page on ThingsBoard Edge.
-
Cloud Events - Learn about Cloud Events page on ThingsBoard Edge.
-
-
Use cases:
-
Manage alarms and RPC requests on edge devices - This guide will show how to generate local alarms on the edge and send RPC requests to devices connected to edge:
-
Data filtering and traffic reduce - This guide will show how to send to cloud from edge only filterd amount of device data:
-
-
Roadmap - ThingsBoard Edge roadmap.