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

Method test_min_max_version_tlsv1_2

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

Source from the content-addressed store, hash-verified

4200 @requires_tls_version('TLSv1')
4201 @ignore_deprecation
4202 def test_min_max_version_tlsv1_2(self):
4203 client_context, server_context, hostname = testing_context()
4204 # client TLSv1.0 to 1.2
4205 client_context.minimum_version = ssl.TLSVersion.TLSv1
4206 client_context.maximum_version = ssl.TLSVersion.TLSv1_2
4207 # server only TLSv1.2
4208 server_context.minimum_version = ssl.TLSVersion.TLSv1_2
4209 server_context.maximum_version = ssl.TLSVersion.TLSv1_2
4210
4211 with ThreadedEchoServer(context=server_context) as server:
4212 with client_context.wrap_socket(socket.socket(),
4213 server_hostname=hostname) as s:
4214 s.connect((HOST, server.port))
4215 self.assertEqual(s.version(), 'TLSv1.2')
4216
4217 @requires_tls_version('TLSv1_1')
4218 @ignore_deprecation

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected