File python-2.7.9-sles-disable-verification-by-default.patch of Package python (Revision 45c655118baafa05bf3b932915819c13)
Currently displaying revision 45c655118baafa05bf3b932915819c13 , Show latest
26
1
---
2
Lib/ssl.py | 12 +++++++++++-
3
1 file changed, 11 insertions(+), 1 deletion(-)
4
5
--- a/Lib/ssl.py
6
+++ b/Lib/ssl.py
7
8
return _create_unverified_context
9
return create_default_context
10
11
-_create_default_https_context = _get_https_context_factory()
12
+try:
13
+ # load the TLS checks policy from separate package
14
+ import sle_tls_checks_policy as policy
15
+ if policy.get_policy:
16
+ _create_default_https_context = policy.get_policy()
17
+ else:
18
+ # empty policy file means simply enable strict verification
19
+ _create_default_https_context = _get_https_context_factory()
20
+except ImportError:
21
+ # policy not present, disable verification for backwards compatibility
22
+ _create_default_https_context = _create_unverified_context
23
24
# PEP 493: "private" API to configure HTTPS defaults without monkeypatching
25
def _https_verify_certificates(enable=True):
26