From 9630784df901cfa5da8f590b9391de8bc945ca61 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 12 Apr 2021 12:00:38 +0200 Subject: [PATCH] bpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355) Signed-off-by: Christian Heimes (cherry picked from commit 3447750073aff229b049e4ccd6217db2811dcfd1) Co-authored-by: Christian Heimes --- Lib/test/test_ssl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index a7ec6c322ee4638..f691b2820a46d2e 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -157,7 +157,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):