(cafile)
| 43 | |
| 44 | @staticmethod |
| 45 | def _ssl_verified_context(cafile): |
| 46 | cfg = Config() |
| 47 | context = None |
| 48 | try: |
| 49 | context = ssl.create_default_context(cafile=cafile) |
| 50 | except AttributeError: # no ssl.create_default_context |
| 51 | pass |
| 52 | if context and not cfg.check_ssl_hostname: |
| 53 | context.check_hostname = False |
| 54 | debug(u'Disabling SSL certificate hostname checking') |
| 55 | |
| 56 | return context |
| 57 | |
| 58 | @staticmethod |
| 59 | def _ssl_unverified_context(cafile): |