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

Method test_tls1_3

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

Source from the content-addressed store, hash-verified

3898
3899 @requires_tls_version('TLSv1_3')
3900 def test_tls1_3(self):
3901 client_context, server_context, hostname = testing_context()
3902 client_context.minimum_version = ssl.TLSVersion.TLSv1_3
3903 with ThreadedEchoServer(context=server_context) as server:
3904 with client_context.wrap_socket(socket.socket(),
3905 server_hostname=hostname) as s:
3906 s.connect((HOST, server.port))
3907 self.assertIn(s.cipher()[0], {
3908 'TLS_AES_256_GCM_SHA384',
3909 'TLS_CHACHA20_POLY1305_SHA256',
3910 'TLS_AES_128_GCM_SHA256',
3911 })
3912 self.assertEqual(s.version(), 'TLSv1.3')
3913
3914 @requires_tls_version('TLSv1_2')
3915 @requires_tls_version('TLSv1')

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected