Replies: 7 comments
-
Tls error 0 means that tls was successful. Your error is on the Mqtt layer, not on the TLS layer. Error rc 5 means that Mqtt authentication failed. Check the user, password or device name |
Beta Was this translation helpful? Give feedback.
-
Thank for your answer ! I'm certain user and password are correct since I use a keepass and I just doublecheck it. |
Beta Was this translation helpful? Give feedback.
-
I just tried with the same configuration but with TLS disabled and the connexion to the MQTT broker is working user_config_override.h
#undef STA_SSID1
#define STA_SSID1 "Livebox-XXXX"
#undef STA_PASS1
#define STA_PASS1 "secret"
#undef MQTT_HOST
#define MQTT_HOST "mqtt.home"
//#ifndef USE_MQTT_TLS
//#define USE_MQTT_TLS
//#undef MQTT_TLS_ENABLED
//#define MQTT_TLS_ENABLED true
//#define USE_MQTT_TLS_CA_CERT
//#define USE_MQTT_AWS_IOT
//#define USE_MQTT_TLS_FORCE_EC_CIPHER
//#endif
#undef MQTT_PORT
#define MQTT_PORT 1883
#undef MQTT_USER
#define MQTT_USER "MQTT_USER"
#undef MQTT_PASS
#define MQTT_PASS "secret" |
Beta Was this translation helpful? Give feedback.
-
That's strange. Error codes are explicit. The error comes from the Mqtt layer. Do you have lower level logs on the Mqtt broker side? |
Beta Was this translation helpful? Give feedback.
-
I did some inspection on the MQTT layer, turns out that the Sonoff is sending the client certificat's CN as the user for MQTT. So I added If I can make a side suggestion, maybe it could help troubleshooting to add the meaning of error code 0 according to the rc value in this table ? https://tasmota.github.io/docs/TLS/#tls-troubleshooting |
Beta Was this translation helpful? Give feedback.
-
Oh yes, that was a long time ago and I don't use mutual TLS anymore. This is hardcoded and this is the way AWS IoT works. To change this you will need to send a Pull Request. |
Beta Was this translation helpful? Give feedback.
-
Moving to discussions as this has become a feature request. |
Beta Was this translation helpful? Give feedback.
-
PROBLEM DESCRIPTION
While following this documentation : https://tasmota.github.io/docs/Self-signed-Mosquitto/
This doc is very precise and useful, and I managed to go through without major hiccups.
Most of the errors I got were on my end, understandable through error codes and I corrected them (ex : typo on fingerprint, error while copying CA, etc). But then I ended up with a
MQT: TLS connection error: 0
that I could not resolve.I believe it's an error on the firmware ends because I got another mqtt client to connect without issues.
I tried with differents configurations as listed bellow.
I ran an sslscan to ensure the server was listening with the proper ciphersuite (ECDHE-RSA-AES128-GCM-SHA256) and TLS (1.2) versions as specified here : https://tasmota.github.io/docs/TLS/#limitations
I'm not sure but maybe the absence of error code is an issue in itself ?
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
I followed every step of this documentation with 3 different machines as advised :
https://tasmota.github.io/docs/Self-signed-Mosquitto/
I configured the extra steps for full CA validation but I tried with classic fingerprinting as well in order to troobleshoot but got the same issue.
The CA is working because I checked the server certificate with sslscan and I got another mqtt client working with TLS and client certificates.
Here is my user_config_override.h. I commented the lines to explain what tests I did to troobleshoot.
I used home assistant mosquitto add-on as a broker with custom configuration in order to follow what's indicated in the documentation. (I disabled the integrated TLS configuration in order for mosquitto to use the custom one, and I tried with another client and it work)
I tried to force TLS version and ciphersuite.
Here is an extract of my mosquitto configuration with comments
EXPECTED BEHAVIOUR
I expect Tasmota to join the MQTT Broker through TLS without faillure
SCREENSHOTS
N/A
ADDITIONAL CONTEXT
The issue probably happens after the TLS handshake because I can see the handshake failling between the startup of the sonoff and the time I run the TlsKey1 et TlsKey2 commands.
I can the that through Tasmota error code 296 and mosquitto error (SSL routines:tls_process_client_certificate:peer did not return a certificate)
The TLS connection error: 0 happens afterwards.
(Please, remember to close the issue when the problem has been addressed)
Beta Was this translation helpful? Give feedback.
All reactions