pyunifi icon indicating copy to clipboard operation
pyunifi copied to clipboard

ssl_verify attempt to suppress warnings is broken

Open davidc opened this issue 4 years ago • 1 comments

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 avatar Jul 01 '21 16:07 davidc

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)

caco3 avatar Sep 26 '21 20:09 caco3