MQTTS with an EPD Using a Non-Public Certificate
1. Introduction
This document describes how to configure MQTT over TLS (MQTTS) for EPD devices using a certificate issued by a non-public certificate authority (CA), such as a company certificate or a self-signed certificate.
The goal is to provide encrypted and secure communication between the EPD and the MQTT broker.
Public root certificates from well-known certificate authorities (public CAs) are preinstalled on the EPD. This article is only for users of non-public root certificates, such as company or self-signed CAs. These certificates must be installed explicitly on the EPD and referenced in the configuration.
2. System Overview and Requirements
2.1 Components
- EPD (firmware ≥ 1.2.8)
- MQTT broker (port 8883, TLS enabled)
- Wi-Fi infrastructure
2.2 MQTT Broker Requirements
- TLS enabled (port 8883)
- Server certificate installed correctly
- Certificate matches the broker address exactly (DNS name or IP address)
- MQTT credentials available (username and password)
2.3 Certificates
- Root CA certificate
- DER-encoded (
.der) - PEM format is not accepted
Example: Convert PEM to DER
openssl x509 -in test-ca.pem -out test-ca.der -outform DER
3. Configuration, Installation, and Verification
Trusted certificates cannot be configured through the web interface. Configure them using FWUpdate.
3.1 JSON Configuration (epd-config.json)
The following configuration is required to enable MQTT over TLS on the EPD:
{
"wifi": {
"ssid": "....",
"password": "....."
},
"mqtt": {
"url": "mqtts://.....:8883",
"username": "....",
"password": "...."
},
"certificate": {
"use_for_mqtt": true,
"file": "test-ca.der"
},
"app": {
"sleep_sec": 60
}
}
Important Rules
- The certificate must be in DER format (
.der). - The certificate file must be in the same directory as
fwupdate.exe. - The field name must be
certificate(notcert). - Do not include unnecessary
nullfields.
3.2 Installing on the EPD
Prepare the Files
Place the following files in the same directory:
- epd-config.json
- Root CA certificate (
.der) - fwupdate.exe
Flashing
.\fwupdate.exe program --config epd-config.json
3.3 Verification
Check the Configuration
.\fwupdate.exe info --config
Expected result:
The certificate field must not be null.
Runtime Test
- The EPD connects to Wi-Fi.
- The MQTT-TLS connection is established.
- The device appears in MQTT Explorer.