Skip to content
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

ssl_verify attempt to suppress warnings is broken #67

Open
davidc opened this issue Jul 1, 2021 · 1 comment · May be fixed by #70
Open

ssl_verify attempt to suppress warnings is broken #67

davidc opened this issue Jul 1, 2021 · 1 comment · May be fixed by #70

Comments

@davidc
Copy link

davidc commented Jul 1, 2021

This code does not work and also if the caller has already called urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) it prevents that from working either:

if ssl_verify is False:
    warnings.simplefilter("default", category=InsecureRequestWarning)

Removing that code from the Controller constructor allows disable_warnings() to do its job again and actually disable the warning.

requests.version
'2.21.0'
urllib3.version
'1.24.1'

pyunifi current git version as of today.

davidc added a commit to davidc/unifi-util that referenced this issue Jul 1, 2021
@caco3
Copy link

caco3 commented Sep 26, 2021

That patch is outdated, simply add

            import urllib3
            urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

after

        if ssl_verify is False:
            warnings.simplefilter("default", category=InsecureRequestWarning)

stblassitude added a commit to stblassitude/pyunifi that referenced this issue Jan 7, 2022
Also fixes suppressing the TLS warning.

Closes finish06#67.
@stblassitude stblassitude linked a pull request Jan 7, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants