bpo-38815: Accept TLSv3 default in min max test (GH-NNNN) (GH-17437)

Make ssl tests less strict and also accept TLSv3 as the default maximum
version. This change unbreaks test_min_max_version on Fedora 32.


https://bugs.python.org/issue38815
This commit is contained in:
torsava 2019-12-02 17:15:42 +01:00 committed by Miss Islington (bot)
parent 2fe4c48917
commit 34864d1cff
1 changed files with 8 additions and 2 deletions

View File

@ -1203,12 +1203,18 @@ class ContextTests(unittest.TestCase):
# RHEL 8 uses TLS 1.2 by default # RHEL 8 uses TLS 1.2 by default
ssl.TLSVersion.TLSv1_2 ssl.TLSVersion.TLSv1_2
} }
maximum_range = {
# stock OpenSSL
ssl.TLSVersion.MAXIMUM_SUPPORTED,
# Fedora 32 uses TLS 1.3 by default
ssl.TLSVersion.TLSv1_3
}
self.assertIn( self.assertIn(
ctx.minimum_version, minimum_range ctx.minimum_version, minimum_range
) )
self.assertEqual( self.assertIn(
ctx.maximum_version, ssl.TLSVersion.MAXIMUM_SUPPORTED ctx.maximum_version, maximum_range
) )
ctx.minimum_version = ssl.TLSVersion.TLSv1_1 ctx.minimum_version = ssl.TLSVersion.TLSv1_1