esphome / esphome/feature-requests
MQTT: Support for Paho tls_set() Function
- Dominant language
- No language data
- Stars
- 450
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem/use-case? Please describe.**
This request is related to a use case. I have an MQTT broker with a Let's Encrypt generated SSL certificate. I'd like my esphomeyaml client to connect to my MQTT broker through and encrypted connection _without having to update the ssl_fingerprints parameter every time a certificate is regenerated._ With Let's Encrypt, certificates are regenerated every 3 months.
**Describe the solution you'd like**
I'd like support for the Eclipse Paho tls_set() function, specifically the ca_certs and cert_reqs parameters. (See tls_set() section at https://www.eclipse.org/paho/clients/python/docs/.) My esphomeyaml client would verify that the MQTT broker has a certificate issued by a recognized CA. If a valid cert is found, MQTT publishing occurs using TLS. If a valid cert is not found, MQTT connection fails.
**Additional context**
I see two ways to use this.
**USE CASE 1: SUPPORT FOR MAJOR CAs**
* When MQTT TLS is requested, esphome includes CA certificates for recognized CAs in the firmware build. This collection would be similar to what major web browser publishers include.
* Esphome invokes Paho MQTT's tls_set function as follows:
* **ca_certs:** points to collection of recognized CA certificates.
* **cert_reqs:** set to ssl.CERT_REQUIRED (technically not necessary since this is the default)
**USE CASE 2: SUPPORT FOR SELF HOSTED CA**
* When MQTT TLS is requested, esphome includes the user-specified CA certificate in the firmware build.
* Esphome invokes Paho MQTT's tls_set function as in Use Case 1, but using the user-specified CA certificate.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.