diff -uNr Python-3.7.0.orig/Lib/test/test_ssl.py Python-3.7.0/Lib/test/test_ssl.py --- Python-3.7.0.orig/Lib/test/test_ssl.py 2018-06-26 22:07:35.000000000 -0500 +++ Python-3.7.0/Lib/test/test_ssl.py 2018-12-28 11:30:01.608382460 -0600 @@ -30,6 +30,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_0 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0) IS_OPENSSL_1_1_1 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 1) PY_SSL_DEFAULT_CIPHERS = sysconfig.get_config_var('PY_SSL_DEFAULT_CIPHERS') @@ -3846,6 +3852,8 @@ sni_name=hostname) 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']