(self)
| 4275 | |
| 4276 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 4277 | def test_sni_callback_raising(self): |
| 4278 | # Raising fails the connection with a TLS handshake failure alert. |
| 4279 | server_context, other_context, client_context = self.sni_contexts() |
| 4280 | |
| 4281 | def cb_raising(ssl_sock, server_name, initial_context): |
| 4282 | 1/0 |
| 4283 | server_context.set_servername_callback(cb_raising) |
| 4284 | |
| 4285 | with support.catch_unraisable_exception() as catch: |
| 4286 | with self.assertRaises(ssl.SSLError) as cm: |
| 4287 | stats = server_params_test(client_context, server_context, |
| 4288 | chatty=False, |
| 4289 | sni_name='supermessage') |
| 4290 | |
| 4291 | # Allow for flexible libssl error messages. |
| 4292 | regex = "(SSLV3_ALERT_HANDSHAKE_FAILURE|NO_PRIVATE_VALUE)" |
| 4293 | self.assertRegex(cm.exception.reason, regex) |
| 4294 | self.assertEqual(catch.unraisable.exc_type, ZeroDivisionError) |
| 4295 | |
| 4296 | @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'SSLEOFError' object has no attribute 'reason' |
| 4297 | def test_sni_callback_wrong_return_type(self): |
nothing calls this directly
no test coverage detected