Open Kolia56 opened 9 months ago
After some troubleshooting, I came to the conclusion that the "fix" masks the fact that login fails at first place. Line 96, I printed resp and it returns 401. So I go back to ssl validation which I think is the root cause. In the meantime I removed the "fix". Any thoughts? Thank you
Any help on this matter? Is there a way to get rid of ssl validation? Thank you
I'm unsure if this will solve your ssl validation issue, but I'm new to unificontrol and was having the same issue as you describe above. This issue https://github.com/nickovs/unificontrol/issues/11 inspired me to omit cert
and site
. For whatever reason, this worked for me. I hope this helps your situation.
>>> from unificontrol import UnifiClient
>>> client = UnifiClient(host="unifi.somewhere.io", username='admin', password='foobar')
>>> client.list_devices_basic()
>>> client.block_client('20:ff:bb:ed:dd:84')
>>> client.unblock_client('20:ff:bb:ed:dd:84')
The main problem here is that this code is 5 years old and since then the whole interface to the Unifi controller has been radically overhauled. Some of the calls are still compatible with the old API but to be honest the entire thing needs to be reworked. Also, it appears that the move to v8 of the controller changed the API endpoints again. Sadly I don't currently have the time to work on this.
I do understand the situation, thank you for your time.
I'm unsure if this will solve your ssl validation issue, but I'm new to unificontrol and was having the same issue as you describe above. This issue #11 inspired me to omit
cert
andsite
. For whatever reason, this worked for me. I hope this helps your situation.>>> from unificontrol import UnifiClient >>> client = UnifiClient(host="unifi.somewhere.io", username='admin', password='foobar') >>> client.list_devices_basic() >>> client.block_client('20:ff:bb:ed:dd:84') >>> client.unblock_client('20:ff:bb:ed:dd:84')
Thank you for your help. Unfortunately it does not work either. It si really a matter of the self signed certificate that has expired
So in the meantime I switched to a Debian VM instance just installed in order to get familiarized with the API. It is running in Python 3.11.2 venv. At first I could not get the SSL verification passing (CloudKey 7.2.97). So I applied this fix and then it passed. The first call used work with no issues
Then I tried added various API calls without any success. I tried to set username and password again, no luck. For instance
triggers an exception
If I understand well there is a loggin issue. However I'm 100% sure of the credentials. What could be wrong then? Thank you