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

Method test_min_max_version_mismatch

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

Source from the content-addressed store, hash-verified

4235 @requires_tls_version('TLSv1')
4236 @ignore_deprecation
4237 def test_min_max_version_mismatch(self):
4238 client_context, server_context, hostname = testing_context()
4239 # client 1.0, server 1.2 (mismatch)
4240 server_context.maximum_version = ssl.TLSVersion.TLSv1_2
4241 server_context.minimum_version = ssl.TLSVersion.TLSv1_2
4242 client_context.maximum_version = ssl.TLSVersion.TLSv1
4243 client_context.minimum_version = ssl.TLSVersion.TLSv1
4244 seclevel_workaround(client_context, server_context)
4245
4246 with ThreadedEchoServer(context=server_context) as server:
4247 with client_context.wrap_socket(socket.socket(),
4248 server_hostname=hostname) as s:
4249 with self.assertRaises(ssl.SSLError) as e:
4250 s.connect((HOST, server.port))
4251 self.assertRegex(str(e.exception), "(alert|ALERT)")
4252
4253 @requires_tls_version('SSLv3')
4254 def test_min_max_version_sslv3(self):

Callers

nothing calls this directly

Calls 9

testing_contextFunction · 0.85
seclevel_workaroundFunction · 0.85
ThreadedEchoServerClass · 0.85
strFunction · 0.85
wrap_socketMethod · 0.80
socketMethod · 0.80
assertRegexMethod · 0.80
assertRaisesMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected