Jump to content
Shelly wiring diagram Now LIVE ×
🌟 NEW Shelly Products Reveal Video! 🌟 NEUE Shelly-Produkte-Enthüllungsvideo! 🌟 ×

Shelly Plug: how to use MQTT with TLS connection


mice777

Recommended Posts

I use MQTT server with ports 1883 and 8883, with self-signed certificate. Tested with other clients, both connections work.

However, I can't make Shelly PlugS to connect over TLS. It works with non-SSL connection.

I set connection type to "User TLS", and disable "Use client cert..." option:

image.png.6bb984ae127376a5e99e73a3fc2f75f9.png

 

Under TLS Configuration settings, I upload PEM file with certificate used by the server:

image.png.0635bc34acfc14228ce953cdde5acdb7.png

The pem file is in format:

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

I don't upload other 2 certificates (Custom client certificate and Custom client key) because I disabled client identification.

 

I restart the device, and watch logs:

Shelly:

shos_mqtt_conn.c:623 MQTT0: Connecting to 192.168.1.40 (192.168.1.40:8883) SSL
shos_mqtt_conn.c:512 MQTT0: Connect status 256
shos_mqtt_conn.c:885 MQTT0: Connecting after 55117 ms

Server log:

2024-08-12 01:57:37,993 TRACE - Client with IP '192.168.1.231' sent SNI hostname '192.168.1.40'
2024-08-12 01:57:38,024 TRACE - Client null disconnected ungracefully.

So the result is that Shelly can't connect to my mqtt server over SSL.

Can someone explain me how is this supposed to work?

 

Link to comment
Share on other sites

Well, I made it work, but using standard server certificate. I didn't need to use user TLS.

Problem was that Shelly failed to connect to HiveMQ broker, but I replaced it by Mosquitto, since then TLS connections work as expected.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...