MQTT broker cert is expiring - best way to increase lifetime of new devices?
Posted: Mon Jul 07, 2025 3:01 pm
Hello.
I have a project built using an ESP32 with Micropython. I am relying on an external MQTT broker - namely mqtt.thingsboard.cloud. How I have currently set up the device is that it only trusts the root certificate of mqtt.thingsboard.cloud. This certificate is provided by the company hosting the mqtt.thingsboard.cloud server here: https://thingsboard.io/docs/paas/user-g ... a-root.pem.
The problem is that their root certificate expires in 2029, and I need a longer lifetime for new devices that are being shipped out (at least 10 years):
I would need some help understanding how I should go about here.
FIRST QUESTION:
I do not really understand how the certificate expiry process works. I know that the device will not be able to connect to the server after the expiry date (December 31, 2028). But what happens the period before that? I assume that Thingsboard would provision a new root certificate someday. I would imagine that this will happen before the expiry date, so that there is a transition period, where both the new and old root certificate works. But I do not think that this is reality - correct?
SECOND QUESTION:
This leads me to the second question. I will need to renew the root certificates once they have expired. Currently, I see two options:
1) Hosting my own MQTT server with a longer certificate expiry period. I have not gone down this route yet, so I am unsure if I can get a certificate that expires in 10+ years without paying a lot of $$.
2) Implementing OTA on a separate server - also with a longer certificate expiry period. This server would be able to provision new certificates even when the MQTT connection starts failing in 2029. However, it will not run forever - eventually that OTA server's certificate is going to expire, and then there is no way for OTA updates to happen.
And my question here is then - are these my only two alternatives? Is it anything else that I should consider?
Note that I require MQTT-over-TLS, so if I am going to do OTA it must also be over TLS. Switching to anything that is more insecure than what I currently have is not an option.
I have a project built using an ESP32 with Micropython. I am relying on an external MQTT broker - namely mqtt.thingsboard.cloud. How I have currently set up the device is that it only trusts the root certificate of mqtt.thingsboard.cloud. This certificate is provided by the company hosting the mqtt.thingsboard.cloud server here: https://thingsboard.io/docs/paas/user-g ... a-root.pem.
The problem is that their root certificate expires in 2029, and I need a longer lifetime for new devices that are being shipped out (at least 10 years):
I would need some help understanding how I should go about here.
FIRST QUESTION:
I do not really understand how the certificate expiry process works. I know that the device will not be able to connect to the server after the expiry date (December 31, 2028). But what happens the period before that? I assume that Thingsboard would provision a new root certificate someday. I would imagine that this will happen before the expiry date, so that there is a transition period, where both the new and old root certificate works. But I do not think that this is reality - correct?
SECOND QUESTION:
This leads me to the second question. I will need to renew the root certificates once they have expired. Currently, I see two options:
1) Hosting my own MQTT server with a longer certificate expiry period. I have not gone down this route yet, so I am unsure if I can get a certificate that expires in 10+ years without paying a lot of $$.
2) Implementing OTA on a separate server - also with a longer certificate expiry period. This server would be able to provision new certificates even when the MQTT connection starts failing in 2029. However, it will not run forever - eventually that OTA server's certificate is going to expire, and then there is no way for OTA updates to happen.
And my question here is then - are these my only two alternatives? Is it anything else that I should consider?
Note that I require MQTT-over-TLS, so if I am going to do OTA it must also be over TLS. Switching to anything that is more insecure than what I currently have is not an option.