Skip to content

Commit 34de2d3

Browse files
tiranvstinner
authored andcommitted
bpo-35045: Accept TLSv1 default in min max test (GH-11510)
Make ssl tests less strict and also accept TLSv1 as system default. The changes unbreaks test_min_max_version on Fedora 29. Signed-off-by: Christian Heimes <christian@python.org>
1 parent 36d9e9a commit 34de2d3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Lib/test/test_ssl.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,11 @@ def test_hostname_checks_common_name(self):
10881088
"required OpenSSL 1.1.0g")
10891089
def test_min_max_version(self):
10901090
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
1091-
self.assertEqual(
1092-
ctx.minimum_version, ssl.TLSVersion.MINIMUM_SUPPORTED
1091+
# OpenSSL default is MINIMUM_SUPPORTED, however some vendors like
1092+
# Fedora override the setting to TLS 1.0.
1093+
self.assertIn(
1094+
ctx.minimum_version,
1095+
{ssl.TLSVersion.MINIMUM_SUPPORTED, ssl.TLSVersion.TLSv1}
10931096
)
10941097
self.assertEqual(
10951098
ctx.maximum_version, ssl.TLSVersion.MAXIMUM_SUPPORTED
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Make ssl tests less strict and also accept TLSv1 as system default. The
2+
changes unbreaks test_min_max_version on Fedora 29.

0 commit comments

Comments
 (0)