Skip to content

Commit

Permalink
bpo-34001: Fix test_ssl with LibreSSL (GH-13783) (#15997)
Browse files Browse the repository at this point in the history
(cherry picked from commit c9bc49c)

Co-authored-by: Christian Heimes <christian@python.org>
  • Loading branch information
2 people authored and matrixise committed Sep 11, 2019
1 parent c0acc0e commit d6ac67f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/test/test_ssl.py
Expand Up @@ -1106,6 +1106,7 @@ def test_hostname_checks_common_name(self):

@unittest.skipUnless(hasattr(ssl.SSLContext, 'minimum_version'),
"required OpenSSL 1.1.0g")
@unittest.skipIf(IS_LIBRESSL, "see bpo-34001")
def test_min_max_version(self):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
# OpenSSL default is MINIMUM_SUPPORTED, however some vendors like
Expand Down Expand Up @@ -3726,8 +3727,8 @@ def test_min_max_version(self):
self.assertEqual(s.version(), 'TLSv1.1')

# client 1.0, server 1.2 (mismatch)
server_context.minimum_version = ssl.TLSVersion.TLSv1_2
server_context.maximum_version = ssl.TLSVersion.TLSv1_2
server_context.minimum_version = ssl.TLSVersion.TLSv1_2
client_context.maximum_version = ssl.TLSVersion.TLSv1
client_context.maximum_version = ssl.TLSVersion.TLSv1
with ThreadedEchoServer(context=server_context) as server:
Expand Down
@@ -0,0 +1,2 @@
Make test_ssl pass with LibreSSL. LibreSSL handles minimum and maximum TLS
version differently than OpenSSL.

0 comments on commit d6ac67f

Please sign in to comment.