projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
051c462
)
[utils] Make ssl work on Python 2.7.8
author
Philipp Hagemeister
<phihag@phihag.de>
Sat, 13 Dec 2014 22:27:21 +0000
(23:27 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Sat, 13 Dec 2014 22:27:21 +0000
(23:27 +0100)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index ec34dcef935240ef8cfb43d00e8589c4fd0040a1..ac66f3de0c0005795fafc2774f04a90581cde803 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-393,8
+393,14
@@
def make_HTTPS_handler(opts_no_check_certificate, **kwargs):
context.options &= ~ssl.OP_NO_SSLv3 # Allow older, not-as-secure SSLv3
if opts_no_check_certificate:
context.verify_mode = ssl.CERT_NONE
context.options &= ~ssl.OP_NO_SSLv3 # Allow older, not-as-secure SSLv3
if opts_no_check_certificate:
context.verify_mode = ssl.CERT_NONE
- return compat_urllib_request.HTTPSHandler(context=context, **kwargs)
- elif sys.version_info < (3, 2):
+ try:
+ return compat_urllib_request.HTTPSHandler(context=context, **kwargs)
+ except TypeError:
+ # Python 2.7.8
+ # (create_default_context present but HTTPSHandler has no context=)
+ pass
+
+ if sys.version_info < (3, 2):
import httplib
class HTTPSConnectionV3(httplib.HTTPSConnection):
import httplib
class HTTPSConnectionV3(httplib.HTTPSConnection):