[Python-checkins] bpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355)

miss-islington webhook-mailer at python.org
Mon Apr 12 06:24:57 EDT 2021


https://github.com/python/cpython/commit/0983e01837714524fb164e784a8e96a2bc4bdf94
commit: 0983e01837714524fb164e784a8e96a2bc4bdf94
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-04-12T03:24:48-07:00
summary:

bpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355)


Signed-off-by: Christian Heimes <christian at python.org>
(cherry picked from commit 3447750073aff229b049e4ccd6217db2811dcfd1)

Co-authored-by: Christian Heimes <christian at python.org>

files:
M Lib/test/test_ssl.py

diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index fdd557c861dc2..3f49c1c1f69ea 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -164,7 +164,10 @@ def is_ubuntu():
     def seclevel_workaround(*ctxs):
         """"Lower security level to '1' and allow all ciphers for TLS 1.0/1"""
         for ctx in ctxs:
-            if ctx.minimum_version <= ssl.TLSVersion.TLSv1_1:
+            if (
+                hasattr(ctx, "minimum_version") and
+                ctx.minimum_version <= ssl.TLSVersion.TLSv1_1
+            ):
                 ctx.set_ciphers("@SECLEVEL=1:ALL")
 else:
     def seclevel_workaround(*ctxs):



More information about the Python-checkins mailing list