nvda
566a5e1c - updateCheck: Fix fetching of server certificate for Python 3 (#12729)

Commit
4 years ago
updateCheck: Fix fetching of server certificate for Python 3 (#12729) When checking for updates to NVDA and certificate of NV Access's server is not installed on the system (this most commonly happens for clean Windows installs) we need to fetch it manually as Python does not do this for us. To do this we're catching errors during connection to the server and then inspecting raised exception to determine if it has been caused by missing certificate and if so we're asking Windows to fetch it for us. This does not work in Python3 however as the structure of the exception from SSL has changed. Description of how this pull request fixes the issue: 1. Since strerror of SSL exceptions is empty in Python 3 we need to inspect its reason to get to the cause of the failure. 2. When the exception is caused by lack of certificate in Python 3 it is represented by ssl.SSLCertVerificationError not a less specific SSLError
Author
Parents
Loading