void-packages/srcpkgs/python3/patches/libressl-2.6.patch

27 lines
995 B
Diff

https://github.com/python/cpython/pull/4930
--- Lib/test/test_ssl.py.orig
+++ Lib/test/test_ssl.py
@@ -29,6 +29,12 @@
PROTOCOLS = sorted(ssl._PROTOCOL_NAMES)
HOST = support.HOST
IS_LIBRESSL = ssl.OPENSSL_VERSION.startswith('LibreSSL')
+if IS_LIBRESSL:
+ LIBRESSL_VERSION = tuple(
+ int(s) for s in ssl.OPENSSL_VERSION.rsplit(' ')[-1].split('.')
+ )
+else:
+ LIBRESSL_VERSION = ()
IS_OPENSSL_1_1 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0)
@@ -3392,6 +3398,8 @@ def test_selected_npn_protocol(self):
chatty=True, connectionchatty=True)
self.assertIs(stats['client_npn_protocol'], None)
+ @unittest.skipIf(IS_LIBRESSL and LIBRESSL_VERSION >= (2, 6, 1),
+ "LibreSSL 2.6.1+ has broken NPN support")
@unittest.skipUnless(ssl.HAS_NPN, "NPN support needed for this test")
def test_npn_protocols(self):
server_protocols = ['http/1.1', 'spdy/2']