Provides a wrong sni hint to validate an exception is thrown.
(self)
| 408 | |
| 409 | @pytest.mark.timeout(PER_TEST_TIMEOUT) |
| 410 | def test_wrong_sni_hint(self) -> None: |
| 411 | """ |
| 412 | Provides a wrong sni hint to validate an exception is thrown. |
| 413 | """ |
| 414 | self.start_destination_server() |
| 415 | self.start_proxy_server() |
| 416 | |
| 417 | sock = socket.create_connection( |
| 418 | (self.proxy_server.host, self.proxy_server.port) |
| 419 | ) |
| 420 | with self.client_context.wrap_socket( |
| 421 | sock, server_hostname="localhost" |
| 422 | ) as proxy_sock: |
| 423 | with pytest.raises(ssl.SSLCertVerificationError): |
| 424 | SSLTransport( |
| 425 | proxy_sock, self.client_context, server_hostname="veryverywrong" |
| 426 | ) |
| 427 | |
| 428 | @pytest.mark.timeout(PER_TEST_TIMEOUT) |
| 429 | @pytest.mark.parametrize("buffering", [None, 0]) |
nothing calls this directly
no test coverage detected