Closed davidc closed 4 years ago
Please confirm you have not set SSL to false.
Correct... that is an SSLError.
Here is the code, it works fine if you manually frig Unifi's settings to support TLSv1.2, but the average user should not be expected to do this, the default out of the box fresh controller install only supports TLS v1.
https://github.com/davidc/unifi-util/blob/master/unifiutil.py
@davidc - What operating system are you using?
After researching the topic, I am not aware of a means for the Requests package to handle TLS v1. This is definitely an problem however it is not something that can be fixed. Unifi needs to update to an acceptable security standard.
Connecting (at least with Python 3.7) gives the error:
requests.exceptions.SSLError: HTTPSConnectionPool(host='xxx', port=8443): Max retries exceeded with url: /api/login (Caused by SSLError(SSLError(1, '[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:1056)')))
Caused by the Unifi controller supporting only TLS v1.
This can be resolved by manually adjusting your controller to support TLSv1.2, however given that Ubiquiti have deemed the default to be only TLSv1 support, this API probably should support it.