-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Tightening the runtime type check for ssl (#7698) #8042
Tightening the runtime type check for ssl (#7698) #8042
Conversation
Currently, the valid types of ssl parameter are SSLContext, Literal[False], Fingerprint or None. If user sets ssl = False, we disable ssl certificate validation which makes total sense. But if user set ssl = True by mistake, instead of enabling ssl certificate validation or raising errors, we silently disable the validation too which is a little subtle but weird. In this PR, we added a check that if user sets ssl=True, we enable certificate validation by treating it as using Default SSL Context. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> Co-authored-by: Sam Bull <aa6bs0@sambull.org> Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: Sam Bull <git@sambull.org> (cherry picked from commit 9e14ea1)
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## 3.10 #8042 +/- ##
==========================================
- Coverage 97.40% 97.39% -0.01%
==========================================
Files 108 108
Lines 32810 32813 +3
Branches 3902 3903 +1
==========================================
Hits 31958 31958
- Misses 648 650 +2
- Partials 204 205 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Backport to 3.9: 💚 backport PR created✅ Backport PR branch: Backported as #8043 🤖 @patchback |
Currently, the valid types of ssl parameter are SSLContext, Literal[False], Fingerprint or None. If user sets ssl = False, we disable ssl certificate validation which makes total sense. But if user set ssl = True by mistake, instead of enabling ssl certificate validation or raising errors, we silently disable the validation too which is a little subtle but weird. In this PR, we added a check that if user sets ssl=True, we enable certificate validation by treating it as using Default SSL Context. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> Co-authored-by: Sam Bull <aa6bs0@sambull.org> Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: Sam Bull <git@sambull.org> (cherry picked from commit 9e14ea1) (cherry picked from commit 4b91b53)
…or ssl (#7698) (#8043) **This is a backport of PR #8042 as merged into 3.10 (4b91b53).** Currently, the valid types of ssl parameter are SSLContext, Literal[False], Fingerprint or None. If user sets ssl = False, we disable ssl certificate validation which makes total sense. But if user set ssl = True by mistake, instead of enabling ssl certificate validation or raising errors, we silently disable the validation too which is a little subtle but weird. In this PR, we added a check that if user sets ssl=True, we enable certificate validation by treating it as using Default SSL Context. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua> Co-authored-by: Sam Bull <aa6bs0@sambull.org> Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: Sam Bull <git@sambull.org> (cherry picked from commit 9e14ea1)
Currently, the valid types of ssl parameter are SSLContext, Literal[False], Fingerprint or None.
If user sets ssl = False, we disable ssl certificate validation which makes total sense. But if user set ssl = True by mistake, instead of enabling ssl certificate validation or raising errors, we silently disable the validation too which is a little subtle but weird.
In this PR, we added a check that if user sets ssl=True, we enable certificate validation by treating it as using Default SSL Context.
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko wk.cvs.github@sydorenko.org.ua
Co-authored-by: Sam Bull aa6bs0@sambull.org
Co-authored-by: J. Nick Koston nick@koston.org
Co-authored-by: Sam Bull git@sambull.org
(cherry picked from commit 9e14ea1)
What do these changes do?
Are there changes in behavior for the user?
Related issue number
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.