(self)
| 3980 | self.assertEqual(s.version(), 'SSLv3') |
| 3981 | |
| 3982 | def test_default_ecdh_curve(self): |
| 3983 | # Issue #21015: elliptic curve-based Diffie Hellman key exchange |
| 3984 | # should be enabled by default on SSL contexts. |
| 3985 | client_context, server_context, hostname = testing_context() |
| 3986 | # TLSv1.3 defaults to PFS key agreement and no longer has KEA in |
| 3987 | # cipher name. |
| 3988 | client_context.maximum_version = ssl.TLSVersion.TLSv1_2 |
| 3989 | # Prior to OpenSSL 1.0.0, ECDH ciphers have to be enabled |
| 3990 | # explicitly using the 'ECCdraft' cipher alias. Otherwise, |
| 3991 | # our default cipher list should prefer ECDH-based ciphers |
| 3992 | # automatically. |
| 3993 | with ThreadedEchoServer(context=server_context) as server: |
| 3994 | with client_context.wrap_socket(socket.socket(), |
| 3995 | server_hostname=hostname) as s: |
| 3996 | s.connect((HOST, server.port)) |
| 3997 | self.assertIn("ECDH", s.cipher()[0]) |
| 3998 | |
| 3999 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 4000 | @unittest.skipUnless("tls-unique" in ssl.CHANNEL_BINDING_TYPES, |
nothing calls this directly
no test coverage detected