Skip to content

Commit 4119a70

Browse files
tiranmiss-islington
authored andcommitted
bpo-4379: Skip TLS 1.0/1.1 tests under OpenSSL 3.0.0 (pythonGH-25304)
Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 5151d64) Co-authored-by: Christian Heimes <christian@python.org>
1 parent 4d9336d commit 4119a70

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Lib/test/test_ssl.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
IS_LIBRESSL = ssl.OPENSSL_VERSION.startswith('LibreSSL')
3939
IS_OPENSSL_1_1_0 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0)
4040
IS_OPENSSL_1_1_1 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 1)
41+
IS_OPENSSL_3_0_0 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (3, 0, 0)
4142
PY_SSL_DEFAULT_CIPHERS = sysconfig.get_config_var('PY_SSL_DEFAULT_CIPHERS')
4243

4344
PROTOCOL_TO_TLS_VERSION = {}
@@ -208,6 +209,10 @@ def has_tls_version(version):
208209
if not getattr(ssl, f'HAS_{version.name}'):
209210
return False
210211

212+
if IS_OPENSSL_3_0_0 and version < ssl.TLSVersion.TLSv1_2:
213+
# bpo43791: 3.0.0-alpha14 fails with TLSV1_ALERT_INTERNAL_ERROR
214+
return False
215+
211216
# check runtime and dynamic crypto policy settings. A TLS version may
212217
# be compiled in but disabled by a policy or config option.
213218
ctx = ssl.SSLContext()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
OpenSSL 3.0.0: Disable testing of legacy protocols TLS 1.0 and 1.1. Tests
2+
are failing with TLSV1_ALERT_INTERNAL_ERROR.

0 commit comments

Comments
 (0)