Skip to content

updateCheck: Fix fetching of server certificate for Python 3#12729

Merged
michaelDCurran merged 2 commits into
nvaccess:masterfrom
lukaszgo1:py3FetchServerCert
Aug 11, 2021
Merged

updateCheck: Fix fetching of server certificate for Python 3#12729
michaelDCurran merged 2 commits into
nvaccess:masterfrom
lukaszgo1:py3FetchServerCert

Conversation

@lukaszgo1

Copy link
Copy Markdown
Contributor

Link to issue number:

None

Summary of the issue:

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

Testing strategy:

I've created two launchers of NVDA as follows: scons launcher version-2020.3 updateVersionType=stable the first one from master, the second from the code from this PR. On the clean Windows 10 VM made sure that the build from the current master fails to check for updates whereas the one with the fix from this PR can successfully check for update and download it.

Known issues with pull request:

None known

Change log entries:

Bug fixes

  • It is once again possible to check for NVDA updates on certain systems; e.g. clean Windows installs.

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual testing.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers

@lukaszgo1 lukaszgo1 requested a review from a team as a code owner August 11, 2021 18:48
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 this pull request may close these issues.

3 participants