Skip to content
This repository has been archived by the owner on Apr 5, 2021. It is now read-only.

Swap to SleekXMPP-FS, a fork built specifically for sucks #67

Merged
merged 2 commits into from
Apr 24, 2019

Conversation

OverloadUT
Copy link
Collaborator

I finally have a fix for both #62 and #45!

Problem Statement
If the user has the PYASN1 python library installed, sucks fails to function due to an error thrown in SleekXMPP about a day being out of range (#45). If a workaround is applied (fixing the bug in SleekXMPP or rolling back to 1.3.2), then sucks still fails to function due to at least one of the Ecovacs certificates being expired, causing SleekXMPP to abort. (#62)

A very simple way to work around both of these issues is to simply uninstall PYASN1 (it's only an optional dependency in SleekXMPP, and not installed by default) which will cause SleekXMPP to issue a warning that it is not validating the certificate, and sucks then works just fine. However, this is not an option for environments where sucks is being used as part of a larger project that requires PYASN1 for other parts of its functionality. This is why sucks has not functioned for Home Assistant users for at least 6 months now.

A Short Term Fix
As a short term fix, I have published a fork of SleekXMPP lovingly called "SleekXMPP for Sucks" which has the validation code disabled. This fork does exactly the same thing that SleekXMPP does when PYASN1 is not present (without issuing a warning.) You can see the entirety of the changes in the fork here: OverloadUT/SleekXMPP@de73c44

This is obviously not a great permanent solution. Unfortunately SleekXMPP has not published a new version since 2016, and trying to use the HEAD of the master branch shows that the changes since 2016 have broken Python 3.7 compatibility, and are in an unknown state of stability in general. Therefore, I think this is a passable solution to put in to sucks for now, while we take our time figuring out a longer term solution.

(Migrating to Slixmpp is something I'd like to explore, but when I tried it out, I found that it's not just a drop-in - a few things would need to change, and it would also change sucks's minimum Python version to 3.5 which would require discussion.)

This fork of SleekXMPP disables certificate validation to work around wpietri#62 and wpietri#45

This fix should be seen as a temporary hack until we figure out a long term solution.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants