diff -r f07b855afbb2 Lib/test/test_ssl.py --- a/Lib/test/test_ssl.py Wed Apr 01 18:48:58 2015 +0200 +++ b/Lib/test/test_ssl.py Thu Apr 02 00:19:57 2015 +0200 @@ -124,6 +124,15 @@ needs_sni = unittest.skipUnless(ssl.HAS_SNI, "SNI support needed for this test") +# LibreSSL disable SSLv3 by default +def reactivate_SSLv3(context): + if (can_clear_options() and + context.protocol in [getattr(ssl, 'PROTOCOL_SSLv3', None), + getattr(ssl, 'PROTOCOL_SSLv23', None), + getattr(ssl, 'PROTOCOL_TLSv1', None)]): + context.options &= ~ssl.OP_NO_SSLv3 + + class BasicSocketTests(unittest.TestCase): def test_constants(self): @@ -784,6 +793,7 @@ @skip_if_broken_ubuntu_ssl def test_options(self): ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + reactivate_SSLv3(ctx) # OP_ALL | OP_NO_SSLv2 is the default value self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2, ctx.options) @@ -2184,8 +2194,10 @@ ssl.get_protocol_name(server_protocol), certtype)) client_context = ssl.SSLContext(client_protocol) + reactivate_SSLv3(client_context) client_context.options |= client_options server_context = ssl.SSLContext(server_protocol) + reactivate_SSLv3(server_context) server_context.options |= server_options # NOTE: we must enable "ALL" ciphers on the client, otherwise an