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

Method test_no_shared_ciphers

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

Source from the content-addressed store, hash-verified

3864 self.assertEqual(cm.exception.errno, errno.ENOTCONN)
3865
3866 def test_no_shared_ciphers(self):
3867 client_context, server_context, hostname = testing_context()
3868 # OpenSSL enables all TLS 1.3 ciphers, enforce TLS 1.2 for test
3869 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
3870 # Force different suites on client and server
3871 client_context.set_ciphers("AES128")
3872 server_context.set_ciphers("AES256")
3873 with ThreadedEchoServer(context=server_context) as server:
3874 with client_context.wrap_socket(socket.socket(),
3875 server_hostname=hostname) as s:
3876 with self.assertRaises(OSError):
3877 s.connect((HOST, server.port))
3878 self.assertIn("NO_SHARED_CIPHER", server.conn_errors[0])
3879
3880 def test_version_basic(self):
3881 """

Callers

nothing calls this directly

Calls 8

testing_contextFunction · 0.85
ThreadedEchoServerClass · 0.85
wrap_socketMethod · 0.80
socketMethod · 0.80
assertInMethod · 0.80
set_ciphersMethod · 0.45
assertRaisesMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected