-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLS for MQTT #34
Comments
Hi @jardleex, I was afraid that someday, someone would ask for this... Seriously though: I'm on it. Will result in a bunch of new config vars for this plugin, but that's what certificate handling gets you... ;-) |
Ok, just release v1.5.5 with TLS support for the MQTT sink plugin - give it a whirl, hope this works for you! |
Hello @AnotherDaniel also this change works pretty good. The only thin I noticed worth mentioning is the
|
Have another go - timezone setting support should be there now, and that log message was a mistake. |
Confirmed for 1.5.6 that TZ environment variables works and missing CA certificate error is gone. Thank you! |
Hi, 2024-02-14 11:42:21 INFO Got 401 - trying reauth
2024-02-14 12:42:28 INFO Got 401 - trying reauth
2024-02-14 13:42:36 INFO Got 401 - trying reauth
2024-02-14 14:42:43 INFO Got 401 - trying reauth
2024-02-14 14:43:37 WARNING Disconnected from MQTT Broker
Exception in thread Thread-1 (_thread_main):
Traceback (most recent call last):
File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
File "/usr/lib/python3.11/threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
File "/opt/smahub/.venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 3591, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/opt/smahub/.venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
rc = self._loop(timeout)
^^^^^^^^^^^^^^^^^^^
File "/opt/smahub/.venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 1181, in _loop
rc = self.loop_write()
^^^^^^^^^^^^^^^^^
File "/opt/smahub/.venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 1577, in loop_write
rc = self._packet_write()
^^^^^^^^^^^^^^^^^^^^
File "/opt/smahub/.venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 2464, in _packet_write
write_length = self._sock_send(
^^^^^^^^^^^^^^^^
File "/opt/smahub/.venv/lib/python3.11/site-packages/paho/mqtt/client.py", line 649, in _sock_send
return self._sock.send(buf)
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ssl.py", line 1243, in send
return self._sslobj.write(data)
^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2427)
2024-02-14 14:47:26 INFO SHM2 plugin disabled
2024-02-14 14:47:26 INFO Starting Tripower X source
2024-02-14 14:47:26 INFO EV Charger plugin disabled
2024-02-14 14:47:26 INFO demo source plugin disabled
2024-02-14 14:47:26 INFO Starting MQTT sink
2024-02-14 14:47:26 INFO HA-MQTT sink plugin disabled
2024-02-14 14:47:26 INFO gen_ha_sensors sink plugin disabled
2024-02-14 14:47:26 INFO demo sink plugin disabled
2024-02-14 14:47:26 INFO TLS enabled
2024-02-14 14:47:26 INFO Connected to MQTT Broker Does that say something to you? |
Does it work again after restarting all involved components, do I see that correctly? |
Yes, everything worked again after a restart cycle. I'd be okay for me to close this one here in this state. |
Nah, we can't close this one. |
Ok, I'll also try to reproduce this. |
I did some tests again and only got the issue with MQTTS. With plain MQTT the reconnect worked just fine. |
@jardleex just to let you know I haven't forgotten about this issue - not that much free mind-time at the moment, and when I tried to pick this up my TLS config (that was fine the first time around) refused to work. As I said, not forgotten... |
Add-on: I just figured out what my recent issue was, and have no idea why this ever worked? Anyways - broker-restart-reconnect works for me, but that might not be related to your scenario. But please have a go with v1.6.2 and let me know how that looks for you! |
Hi, Sadly 1.6.2 ain't changed the end result if I restart my broker:
Please let me know if I can provide any additional info to support you. |
Hello,
would it be possible to support TLS on the MQTT sink?
I wanted to lock down my home automation a bit more and as I got quite some stuff going on via MQTT it'll be great to secure that.
For some setup's it may also be required to skip certificate validation. I'm using Lets Encrypt here which should work with enabled verification.
Thank you for your work.
Do you have any way of donating to you?
The text was updated successfully, but these errors were encountered: