mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-27 05:43:09 +00:00
* Legacy Python certificate validation fixed
* added changelog fragment
* removed blank line for sanity checks
* Update changelogs/fragments/470-spacewalk-legacy-python-certificate-validation.yaml
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Update changelogs/fragments/470-spacewalk-legacy-python-certificate-validation.yaml
Co-authored-by: jpe <petz.johannes@afb.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
(cherry picked from commit df9f0741b5)
Co-authored-by: Johannes Petz <PetzJohannes@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- rhn_channel - Python 2.7.5 fails if the certificate should not be validated. Fixed this by creating the correct ``ssl_context`` (https://github.com/ansible-collections/community.general/pull/470).
|
||||
@@ -135,7 +135,7 @@ def main():
|
||||
try: # Python 2.7.9 and newer
|
||||
ssl_context = ssl.create_unverified_context()
|
||||
except AttributeError: # Legacy Python that doesn't verify HTTPS certificates by default
|
||||
ssl._create_default_context = ssl._create_unverified_context
|
||||
ssl_context = ssl._create_unverified_context()
|
||||
else: # Python 2.7.8 and older
|
||||
ssl._create_default_https_context = ssl._create_unverified_https_context
|
||||
|
||||
|
||||
Reference in New Issue
Block a user