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

Method test_min_max_version_mismatch

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

Source from the content-addressed store, hash-verified

3950 @requires_tls_version('TLSv1')
3951 @ignore_deprecation
3952 def test_min_max_version_mismatch(self):
3953 client_context, server_context, hostname = testing_context()
3954 # client 1.0, server 1.2 (mismatch)
3955 server_context.maximum_version = ssl.TLSVersion.TLSv1_2
3956 server_context.minimum_version = ssl.TLSVersion.TLSv1_2
3957 client_context.maximum_version = ssl.TLSVersion.TLSv1
3958 client_context.minimum_version = ssl.TLSVersion.TLSv1
3959 seclevel_workaround(client_context, server_context)
3960
3961 with ThreadedEchoServer(context=server_context) as server:
3962 with client_context.wrap_socket(socket.socket(),
3963 server_hostname=hostname) as s:
3964 with self.assertRaises(ssl.SSLError) as e:
3965 s.connect((HOST, server.port))
3966 self.assertRegex(str(e.exception), "(alert|ALERT)")
3967
3968 @requires_tls_version('SSLv3')
3969 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