summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2019-01-18 15:09:30 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-01-18 15:09:30 (GMT)
commit34de2d312b3687994ddbc29adb66e88f672034c7 (patch)
treecd5357057fa8667dd1f3d9d3d7bb130bf570da62
parent36d9e9a4d5238d5a2f09679b6c51be66fbfc12c4 (diff)
downloadcpython-34de2d312b3687994ddbc29adb66e88f672034c7.zip
cpython-34de2d312b3687994ddbc29adb66e88f672034c7.tar.gz
cpython-34de2d312b3687994ddbc29adb66e88f672034c7.tar.bz2
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>
-rw-r--r--Lib/test/test_ssl.py7
-rw-r--r--Misc/NEWS.d/next/Tests/2019-01-10-18-35-42.bpo-35045.qdd6d9.rst2
2 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 1fc657f..9e571cc 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -1088,8 +1088,11 @@ class ContextTests(unittest.TestCase):
"required OpenSSL 1.1.0g")
def test_min_max_version(self):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
- self.assertEqual(
- ctx.minimum_version, ssl.TLSVersion.MINIMUM_SUPPORTED
+ # OpenSSL default is MINIMUM_SUPPORTED, however some vendors like
+ # Fedora override the setting to TLS 1.0.
+ self.assertIn(
+ ctx.minimum_version,
+ {ssl.TLSVersion.MINIMUM_SUPPORTED, ssl.TLSVersion.TLSv1}
)
self.assertEqual(
ctx.maximum_version, ssl.TLSVersion.MAXIMUM_SUPPORTED
diff --git a/Misc/NEWS.d/next/Tests/2019-01-10-18-35-42.bpo-35045.qdd6d9.rst b/Misc/NEWS.d/next/Tests/2019-01-10-18-35-42.bpo-35045.qdd6d9.rst
new file mode 100644
index 0000000..630a22d
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-01-10-18-35-42.bpo-35045.qdd6d9.rst
@@ -0,0 +1,2 @@
+Make ssl tests less strict and also accept TLSv1 as system default. The
+changes unbreaks test_min_max_version on Fedora 29.