comparison cagou/core/patches.py @ 438:58d3ea442f9c

core (patches): renamed `apply` to `disable_tls_validation` which suits better
author Goffi <goffi@goffi.org>
date Sat, 07 Mar 2020 00:05:49 +0100
parents 672880661797
children 3c9ba4a694ef
comparison
equal deleted inserted replaced
437:b5e6d36fbf9c 438:58d3ea442f9c
18 18
19 import urllib.request, urllib.error, urllib.parse 19 import urllib.request, urllib.error, urllib.parse
20 import ssl 20 import ssl
21 21
22 22
23 def apply(): 23 def disable_tls_validation():
24 # allow to disable certificate validation 24 # allow to disable certificate validation
25 ctx_no_verify = ssl.create_default_context() 25 ctx_no_verify = ssl.create_default_context()
26 ctx_no_verify.check_hostname = False 26 ctx_no_verify.check_hostname = False
27 ctx_no_verify.verify_mode = ssl.CERT_NONE 27 ctx_no_verify.verify_mode = ssl.CERT_NONE
28 28