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

fix: handles BSI query URL exception or SSL errors for python 3.8 to 3.11 #231

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

pabloitu
Copy link
Collaborator

@pabloitu pabloitu commented May 31, 2023

The handling of exceptions to query the Italy BSI catalog (due to SSL certificates not being quite alright on their API) must be different from python 3.8 and 3.11 In 3.8, the reason is thrown as a ssl.SSLCertVerificationErros, whereas in 3.11 it is thrown just as a ssl.SSLError, both of which has different codes or error numbers.
Fixed that issue, to the query works for python versions from 3.8 up to 3.11

Type of change:

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Comment on lines +316 to +317
if (isinstance(URLe.reason, ssl.SSLCertVerificationError) and URLe.reason.verify_code == 62) \
or (isinstance(URLe.reason, ssl.SSLError) and URLe.reason.errno == 5):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added additional reason and error code to make this compatible with Python 3.8-3.11.

Copy link
Contributor

@fabiolsilva fabiolsilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added additional reason and error code to make this compatible with Python 3.8-3.11.

@fabiolsilva fabiolsilva merged commit c6d028f into SCECcode:master Jun 6, 2023
@pabloitu pabloitu deleted the bsi_sslcerts branch August 16, 2024 13:29
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.

2 participants