[utils] make_HTTPS_handler: Don't clear options with openssl < 0.9.8m (fixes #4294)

It raises a ValueError exception, see https://docs.python.org/2/library/ssl.html#ssl.SSLContext.options
This commit is contained in:
Jaime Marquínez Ferrándiz 2014-12-13 14:02:33 +01:00
parent 1557ed153c
commit 87c925a82c

View File

@ -390,6 +390,8 @@ def formatSeconds(secs):
def make_HTTPS_handler(opts_no_check_certificate, **kwargs):
if hasattr(ssl, 'create_default_context'): # Python >= 3.4 or 2.7.9
context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
# options can only be cleared with openssl >= 0.9.8m
if ssl.OPENSSL_VERSION_INFO >= (0, 9, 8, 13, 15):
context.options &= ~ssl.OP_NO_SSLv3 # Allow older, not-as-secure SSLv3
if opts_no_check_certificate:
context.verify_mode = ssl.CERT_NONE