diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-12-08 06:54:39 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-12-08 06:54:39 +0100 |
commit | 303b479e0a4b7db5b8e30be6ff3ffc1ea267e87c (patch) | |
tree | 58590370d46759a4f1ebe6a5fd02547dde203992 /youtube_dl | |
parent | 4c5216064657b267de378a84dd8ea4989934f25c (diff) |
Automatically load SSL certs on Windows
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 7b5878830..a84aa59c2 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -561,11 +561,14 @@ def make_HTTPS_handler(opts_no_check_certificate): return HTTPSHandlerV3() else: context = ssl.SSLContext(ssl.PROTOCOL_SSLv3) - context.set_default_verify_paths() - context.verify_mode = (ssl.CERT_NONE if opts_no_check_certificate else ssl.CERT_REQUIRED) + context.set_default_verify_paths() + try: + context.load_default_certs() + except AttributeError: + pass # Python < 3.4 return compat_urllib_request.HTTPSHandler(context=context) class ExtractorError(Exception): |