(self)
| 4647 | self.assertEqual(calls, []) |
| 4648 | |
| 4649 | def test_sni_callback_alert(self): |
| 4650 | # Returning a TLS alert is reflected to the connecting client |
| 4651 | server_context, other_context, client_context = self.sni_contexts() |
| 4652 | |
| 4653 | def cb_returning_alert(ssl_sock, server_name, initial_context): |
| 4654 | return ssl.ALERT_DESCRIPTION_ACCESS_DENIED |
| 4655 | server_context.set_servername_callback(cb_returning_alert) |
| 4656 | with self.assertRaises(ssl.SSLError) as cm: |
| 4657 | stats = server_params_test(client_context, server_context, |
| 4658 | chatty=False, |
| 4659 | sni_name='supermessage') |
| 4660 | self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_ACCESS_DENIED') |
| 4661 | |
| 4662 | def test_sni_callback_raising(self): |
| 4663 | # Raising fails the connection with a TLS handshake failure alert. |
nothing calls this directly
no test coverage detected