Appendix E: Configurable MQTT TLS Certificates for Gateway-AC Communication. ABB ATT-VZN Ability Smart Sensor Bluetooth SIM Card Gateway, ATT-VZN
Reklamë
Reklamë
Appendix E: Configurable MQTT TLS Certificates for Gateway-AC
Communication
1. Overview
To further improve the communication security between Cassia IoT Access Controller (AC) and Cassia Bluetooth gateway, Cassia supports configurable MQTT TLS certificates for gateway and AC communication from firmware 2.0.
The user can generate their MQTT certificate and load it in AC and gateway console. If the loaded certificate doesn’t match or expired, the gateway can’t connect to the AC. The certificate can be a CA certificate or a self-signed certificate. Cassia gateway always uses the secured MQTT to communicate with AC, no matter if the default or custom certificate is used.
NOTE
• Only PEM certificate file format is supported
• Don’t support private keys with passphrase protected
• Don’t support certificate revoke
2. AC Configuration
2.1. Open TCP port 8883 on AC Host
TCP port 8883 is used by MQTT protocol between Cassia AC and Cassia Bluetooth gateway.
The user can use NetCat to check if TCP port 8883 is enabled on AC and reachable from the gateway. Please login gateway’s local console, select Other page, and run NetCat like below.
TCP port 8883 has been opened on VMware AC. If the user wants to open TCP port 8883 for
Cassia-hosted AC, please contact Cassia support.
96 Copyright 2021 Cassia Networks, Inc.
2.3. Configure AC Time
NOTE : Please skip this step if the AC is running on the cloud, e.g., Azure or AWS because the time of the host server is always correct.
If the AC is not running on the cloud, it is recommended to switch on “Set the time automatically” and set your own NTP time servers on the AC setting page.
The AC time will be used for certificate validation. If the AC time is not configured correctly, the gateway can’t connect to the AC.
2.4. Configure MQTT Certificate
97 Copyright 2021 Cassia Networks, Inc.
On the AC Settings page, please change MQTT Certificate Configuration from Default to User
Config. Then, please fill in the CA Certificate, Server Certificate, and Server Private Key.
Default means using the default certificate provided by Cassia. The gateway and AC communication is still protected.
3. Gateway Configuration
3.1. Configure Gateway Date
Please configure the correct local date in the gateway’s local console Other tab. After connected to AC, the gateway will get the correct time from AC automatically.
The local date will be used for certificate validation. If the date is not configured correctly, the gateway can’t connect to the AC.
3.2. Configure MQTT Certificate
Please fill in MQTT certificates in the gateway Other tab. Please change Certificate
Configuration to User Config, and then fill in the CA Certificate, Client Certificate, and Client
Private Key.
NOTE
• The AC and gateways should use the same CA certificate.
• Now, we only support bi-directional authentication. It means the gateway will authenticate AC and AC will authenticate gateway too. So, both CA certificate, client certificate, and client private key should be provided on the gateway side.
98 Copyright 2021 Cassia Networks, Inc.
Now, the gateway will connect to the AC automatically.
4. Trouble Shooting and Tips
The AC and gateway console will check the integrity & validity of the certificate and private key. Please check chapter E.1 for the format requirement. If the local date and time are not configured correctly (see chapter E.2.3 and E.3.1), the validity check will fail too.
If the gateway can’t connect to the AC, please double-check if you load the correct certificate and private key. The user can set the Certificate Configuration back to Default to exclude any other issues, e.g., transport issue.
The user can find TLS error logs in the gateway console Log tab.
99 Copyright 2021 Cassia Networks, Inc.
5. Certificate and Private Key Examples
Below is an example of self-signed certificate and keys.
• ca.crt is CA certificate
• server.crt is the server certificate
• server.key is server private key
• client.crt is the client certificate
• client.key is client private key
• Don’t support private key with passphrase protected, e.g., don’t add “-des3” in step
3 and step 6
Openssl command example: openssl genrsa -des3 -out ca.key 2048 openssl req -new -x509 -key ca.key -out ca.crt -days 3650 // generate CA certificate openssl genrsa -out server.key 2048 // generate server private key openssl req -new -key server.key -out server.csr openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial out server.crt // generate server certificate openssl genrsa -out client.key 2048 // generate client private key openssl req -new -key client.key -out client.csr openssl x509 -req -days 3650 -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial out client.crt // generate client certificate ca.crt example:
-----BEGIN CERTIFICATE-----
MIIDdzCCAl+gAwIBAgIJALSD+kQkX3FuMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQxCzAJBgNVBAMMAmRkMB4XDTE5MDUwNTAzMDk0NloXDTIw
MDUwNDAzMDk0NlowUjELMAkGA1UEB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