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

**URL:** <https://forum.cedalo.com/t/no-shared-cipher-with-tasmota-mosquitto-compiled-from-source/384>\
**Category:** Security\
**Created:** [November 14, 2021, 3:16am UTC](https://forum.cedalo.com/t/no-shared-cipher-with-tasmota-mosquitto-compiled-from-source/384 "2021-11-14T03:16:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jadudm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.cedalo.com/jadudm/32/378_2.png) [@jadudm](https://forum.cedalo.com/u/jadudm)\
**Post date:** [November 14, 2021, 3:16am UTC](https://forum.cedalo.com/t/no-shared-cipher-with-tasmota-mosquitto-compiled-from-source/384/1 "2021-11-14T03:16:33Z")

</div>

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:

```auto
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,  
Matt

---

<div class="post-metadata">

**Author:** ![jadudm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.cedalo.com/jadudm/32/378_2.png) [@jadudm](https://forum.cedalo.com/u/jadudm)\
**Post date:** [November 14, 2021, 11:36am UTC](https://forum.cedalo.com/t/no-shared-cipher-with-tasmota-mosquitto-compiled-from-source/384/2 "2021-11-14T11:36:56Z")

</div>

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. 🙂

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:

```auto
build/brssl client mqtt.example.com:443 -cs ECDHE_RSA_WITH_AES_128_GCM_SHA256
WARNING: no configured trust anchor
connecting to: 1.2.3.4
connected.
Algorithms:
   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

---

<div class="post-metadata">

**Author:** ![roger.light](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@roger.light](https://forum.cedalo.com/u/roger.light)\
**Post date:** [November 16, 2021, 11:32am UTC](https://forum.cedalo.com/t/no-shared-cipher-with-tasmota-mosquitto-compiled-from-source/384/3 "2021-11-16T11:32:04Z")

</div>

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