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

Method test_sni_callback_alert

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

Source from the content-addressed store, hash-verified

4261
4262 @unittest.expectedFailure # TODO: RUSTPYTHON; + TLSV1_ALERT_ACCESS_DENIED
4263 def test_sni_callback_alert(self):
4264 # Returning a TLS alert is reflected to the connecting client
4265 server_context, other_context, client_context = self.sni_contexts()
4266
4267 def cb_returning_alert(ssl_sock, server_name, initial_context):
4268 return ssl.ALERT_DESCRIPTION_ACCESS_DENIED
4269 server_context.set_servername_callback(cb_returning_alert)
4270 with self.assertRaises(ssl.SSLError) as cm:
4271 stats = server_params_test(client_context, server_context,
4272 chatty=False,
4273 sni_name='supermessage')
4274 self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_ACCESS_DENIED')
4275
4276 @unittest.expectedFailure # TODO: RUSTPYTHON
4277 def test_sni_callback_raising(self):

Callers

nothing calls this directly

Calls 5

sni_contextsMethod · 0.95
server_params_testFunction · 0.85
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected