MCPcopy Index your code
hub / github.com/python/cpython / test_shared_ciphers

Method test_shared_ciphers

Lib/test/test_ssl.py:4700–4716  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4698 self.assertEqual(catch.unraisable.exc_type, TypeError)
4699
4700 def test_shared_ciphers(self):
4701 client_context, server_context, hostname = testing_context()
4702 client_context.set_ciphers("AES128:AES256")
4703 server_context.set_ciphers("AES256:eNULL")
4704 expected_algs = [
4705 "AES256", "AES-256",
4706 # TLS 1.3 ciphers are always enabled
4707 "TLS_CHACHA20", "TLS_AES",
4708 ]
4709
4710 stats = server_params_test(client_context, server_context,
4711 sni_name=hostname)
4712 ciphers = stats['server_shared_ciphers'][0]
4713 self.assertGreater(len(ciphers), 0)
4714 for name, tls_version, bits in ciphers:
4715 if not any(alg in name for alg in expected_algs):
4716 self.fail(name)
4717
4718 def test_read_write_after_close_raises_valuerror(self):
4719 client_context, server_context, hostname = testing_context()

Callers

nothing calls this directly

Calls 5

testing_contextFunction · 0.85
server_params_testFunction · 0.85
assertGreaterMethod · 0.80
anyFunction · 0.50
failMethod · 0.45

Tested by

no test coverage detected