From: Christian Heimes Date: Thu, 26 Sep 2019 16:23:17 +0000 (+0200) Subject: bpo-38275: Fix test_ssl issue caused by GH-16386 (#16428) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f77268f901cc3e8874e5042361520a0e482476a;p=python bpo-38275: Fix test_ssl issue caused by GH-16386 (#16428) Check presence of SSLContext.minimum_version to make tests pass with old versions of OpenSSL. Signed-off-by: Christian Heimes --- diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 8bb74b4388..3cd6e927a4 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -190,11 +190,13 @@ def has_tls_version(version): # be compiled in but disabled by a policy or config option. ctx = ssl.SSLContext() if ( + hasattr(ctx, 'minimum_version') and ctx.minimum_version != ssl.TLSVersion.MINIMUM_SUPPORTED and version < ctx.minimum_version ): return False if ( + hasattr(ctx, 'maximum_version') and ctx.maximum_version != ssl.TLSVersion.MAXIMUM_SUPPORTED and version > ctx.maximum_version ):