]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35045: Accept TLSv1 default in min max test (GH-11510)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 18 Jan 2019 15:29:08 +0000 (07:29 -0800)
committerGitHub <noreply@github.com>
Fri, 18 Jan 2019 15:29:08 +0000 (07:29 -0800)
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>
(cherry picked from commit 34de2d312b3687994ddbc29adb66e88f672034c7)

Co-authored-by: Christian Heimes <christian@python.org>
Lib/test/test_ssl.py
Misc/NEWS.d/next/Tests/2019-01-10-18-35-42.bpo-35045.qdd6d9.rst [new file with mode: 0644]

index b6794ce3a81748e811af970bbc183ee944d323c6..38ecddd07d98c04158cb7ed986036119eb495d69 100644 (file)
@@ -1108,8 +1108,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 (file)
index 0000000..630a22d
--- /dev/null
@@ -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.