`no shared cipher` with Tasmota/Mosquitto compiled from source

Hi all,

I’m trying to use the broker with Tasmota, a popular FOSS firmware for IoT devices.

I’ve compiled the firmware for Tasmota from source, enabling TLS, ECC, and a setting that should make LetsEncrypt certs “just work.” (My broker host uses LE, and I pass the cafile/keyfile via config.)

I’ve compiled Mosquitto from source as part of a Dockerized build.

I can talk to the broker using mosquitto_sub just fine (forcing either TLS v1.2 or v1.3), but whenever my IoT device tries to say hello, it reports a handshake failure, and the broker says:

OpenSSL Error[0]: error:1417A0C1:SSL routines:tls_post_process_client_hello:no shared cipher

which is odd. Tasmota should be offering ECDHE_RSA_WITH_AES_128_GCM_SHA256 as a cipher via TLSv1.2, according to documentation.

I feel like there must be something obvious that I’m missing.

1a. Could my IoT client be offering an unencrypted connection, and is thus failing the handshake?
1b. Is there a more obvious reason the handshake is failing, and I’m missing it…
2. Do I have something wrong in the mosquitto build?
3. …

I have been digging at this for a while, and have reached the point where I think I’m missing something very obvious.

Many thanks,

I understand what is going on, thanks to a friend at the Tasmota end of the puzzle.

From their response to a question, I discovered that my LetsEncrypt certs won’t play nice with the client, which explains why “big” clients like mosquitto_sub work fine, but my embedded client (using BearSSL) does not.

Problem effectively solved. I now know what I need to do, anyway. :slight_smile:

Hopefully, if someone comes along after me wondering the same thing, this will be a useful nugget in their own quest.

I used the laptop version of BearSSL and I got the same error:

build/brssl client mqtt.example.com:443 -cs ECDHE_RSA_WITH_AES_128_GCM_SHA256
WARNING: no configured trust anchor
connecting to:
   RNG:           rdrand
   AES/CTR:       pwr8
   GHASH (GCM):   pclmul
   EC:            all_m31
   RSA (vrfy):    i62
ERROR: SSL error 296 (received alert 40)

Using OpenSSL shows that Server public key is 384 bit

We don’t support EC keys for servers, they need to be RSA 2048 or 4096. In general we don’t support ECDSA.

You need to generate a new certificate with RSA private/public key


Good that you’ve found the problem at least, I hope you can get it sorted properly!

1 Like