MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_default_ecdh_curve

Method test_default_ecdh_curve

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

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 7

testing_contextFunction · 0.85
ThreadedEchoServerClass · 0.85
wrap_socketMethod · 0.80
socketMethod · 0.80
assertInMethod · 0.80
connectMethod · 0.45
cipherMethod · 0.45

Tested by

no test coverage detected