Skip to content

Commit 5151d64

Browse files
authored
bpo-4379: Skip TLS 1.0/1.1 tests under OpenSSL 3.0.0 (GH-25304)
Signed-off-by: Christian Heimes <[email protected]>
1 parent d3b73f3 commit 5151d64

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
@@ -42,6 +42,7 @@
4242
IS_LIBRESSL = ssl.OPENSSL_VERSION.startswith('LibreSSL')
4343
IS_OPENSSL_1_1_0 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0)
4444
IS_OPENSSL_1_1_1 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 1)
45+
IS_OPENSSL_3_0_0 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (3, 0, 0)
4546
PY_SSL_DEFAULT_CIPHERS = sysconfig.get_config_var('PY_SSL_DEFAULT_CIPHERS')
4647

4748
PROTOCOL_TO_TLS_VERSION = {}
@@ -212,6 +213,10 @@ def has_tls_version(version):
212213
if not getattr(ssl, f'HAS_{version.name}'):
213214
return False
214215

216+
if IS_OPENSSL_3_0_0 and version < ssl.TLSVersion.TLSv1_2:
217+
# bpo43791: 3.0.0-alpha14 fails with TLSV1_ALERT_INTERNAL_ERROR
218+
return False
219+
215220
# check runtime and dynamic crypto policy settings. A TLS version may
216221
# be compiled in but disabled by a policy or config option.
217222
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)