Self-signed mosquitto + Tasmota + MQTT TLS no longer working #20716
Replies: 1 comment 10 replies
-
The documentation is still correct. Tasmota expects a RSA certificate for performance reasons (ECDHE is significantly slower, at least on BearSSL). That said, the cipher used is EC P256. You can use EC ciphers based on RSA certificates. This combination is the best compromise between speed and security |
Beta Was this translation helpful? Give feedback.
-
PROBLEM DESCRIPTION
After following the instructions curently outlined in the Self-signed Mosquitto docs I am unable to provision a device to connect to my private broker. The error returned on the web console is as follows:
Error 296 is a SSL3_ALERT_HANDSHAKE_FAILURE. The server logs state the following:
This implies, to me, that either the server or the device do not have the right cipher suite. The likely culprit is the tasmota device as it is configured to use a singular cipher suite here
When I manually use the ca.crt, device.crt and device.pem to try to connect to the server
./BearSSL/build/brssl client mqtt.<my server>.io:8883 \ -CA easy-rsa/easyrsa3/pki/ca.crt \ -cert easy-rsa/easyrsa3/pki/issued/device.crt \ -key easy-rsa/easyrsa3/pki/private/device.pem
We succeed! But the cipher used is
ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
, here is the output.According to the tasmota source code, the only supported cipher is
BR_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
. This implies that the device should be using an RSA cert/private key BUT the documentation only talks about EC. Based on my reading of previous issues, my suspicion is that the source was adapted to support AWS IOT which uses an RSA based cert and the self-signed support was not updated?A few other things I've tried:
BR_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
(which is what bearSSL said worked for the cert/keys I have), this alsodoes not work. Presumably because there are other configuration options that I missed.The documentation here https://tasmota.github.io/docs/TLS/#implementation-notes says the following:
It's very unclear to my how we can force EasyRSA generate a 2048 bit RSA cert but use an EC private key.
So I'm at a bit of a loss, it seems like something switched to RSA at some point but the "Self-signed Mosquitto" documentation still refers to EC? I don't know enough about TLS to find where things are going wrong in the source.
Here is my user_config_override.h
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:Status 0
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:TO REPRODUCE
EXPECTED BEHAVIOUR
A successful MQTT TLS session with a mosquitto broker using a tasmota device
Additional Context
Here is an issue that is similar and recent BUT does not work for me in this case as they are using Let's Encrypt and Home Assistant
#20192
(Please, remember to close the issue when the problem has been addressed)
Beta Was this translation helpful? Give feedback.
All reactions