(self)
| 4265 | self.assertEqual(s.version(), 'SSLv3') |
| 4266 | |
| 4267 | def test_default_ecdh_curve(self): |
| 4268 | # Issue #21015: elliptic curve-based Diffie Hellman key exchange |
| 4269 | # should be enabled by default on SSL contexts. |
| 4270 | client_context, server_context, hostname = testing_context() |
| 4271 | # TLSv1.3 defaults to PFS key agreement and no longer has KEA in |
| 4272 | # cipher name. |
| 4273 | client_context.maximum_version = ssl.TLSVersion.TLSv1_2 |
| 4274 | # Prior to OpenSSL 1.0.0, ECDH ciphers have to be enabled |
| 4275 | # explicitly using the 'ECCdraft' cipher alias. Otherwise, |
| 4276 | # our default cipher list should prefer ECDH-based ciphers |
| 4277 | # automatically. |
| 4278 | with ThreadedEchoServer(context=server_context) as server: |
| 4279 | with client_context.wrap_socket(socket.socket(), |
| 4280 | server_hostname=hostname) as s: |
| 4281 | s.connect((HOST, server.port)) |
| 4282 | self.assertIn("ECDH", s.cipher()[0]) |
| 4283 | |
| 4284 | @unittest.skipUnless("tls-unique" in ssl.CHANNEL_BINDING_TYPES, |
| 4285 | "'tls-unique' channel binding not available") |
nothing calls this directly
no test coverage detected