MCPcopy Index your code
hub / github.com/python/cpython / test_tls1_3

Method test_tls1_3

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

Source from the content-addressed store, hash-verified

4183
4184 @requires_tls_version('TLSv1_3')
4185 def test_tls1_3(self):
4186 client_context, server_context, hostname = testing_context()
4187 client_context.minimum_version = ssl.TLSVersion.TLSv1_3
4188 with ThreadedEchoServer(context=server_context) as server:
4189 with client_context.wrap_socket(socket.socket(),
4190 server_hostname=hostname) as s:
4191 s.connect((HOST, server.port))
4192 self.assertIn(s.cipher()[0], {
4193 'TLS_AES_256_GCM_SHA384',
4194 'TLS_CHACHA20_POLY1305_SHA256',
4195 'TLS_AES_128_GCM_SHA256',
4196 })
4197 self.assertEqual(s.version(), 'TLSv1.3')
4198
4199 @requires_tls_version('TLSv1_2')
4200 @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