(self)
| 2443 | """Tests that connect to a simple server running in the background.""" |
| 2444 | |
| 2445 | def setUp(self): |
| 2446 | server_ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) |
| 2447 | ciphers = [cipher['name'] for cipher in server_ctx.get_ciphers() |
| 2448 | if cipher['protocol'] == 'TLSv1.3'] |
| 2449 | |
| 2450 | if not ciphers: |
| 2451 | self.skipTest("No cipher supports TLSv1.3") |
| 2452 | |
| 2453 | self.matching_cipher = ciphers[0] |
| 2454 | # Some tests need at least two ciphers, and are responsible |
| 2455 | # to skip themselves if matching_cipher == mismatched_cipher. |
| 2456 | self.mismatched_cipher = ciphers[-1] |
| 2457 | |
| 2458 | server_ctx.set_ciphersuites(self.matching_cipher) |
| 2459 | server_ctx.load_cert_chain(SIGNED_CERTFILE) |
| 2460 | server = ThreadedEchoServer(context=server_ctx) |
| 2461 | self.enterContext(server) |
| 2462 | self.server_addr = (HOST, server.port) |
| 2463 | |
| 2464 | def test_ciphersuites(self): |
| 2465 | # Test unrecognized TLS 1.3 cipher suite name |
nothing calls this directly
no test coverage detected