MCPcopy
hub / github.com/urllib3/urllib3 / test_tls_in_tls_tunnel

Method test_tls_in_tls_tunnel

test/test_ssltransport.py:388–407  ·  view source on GitHub ↗

Basic communication over the TLS in TLS tunnel.

(self)

Source from the content-addressed store, hash-verified

386
387 @pytest.mark.timeout(PER_TEST_TIMEOUT)
388 def test_tls_in_tls_tunnel(self) -> None:
389 """
390 Basic communication over the TLS in TLS tunnel.
391 """
392 self.start_destination_server()
393 self.start_proxy_server()
394
395 sock = socket.create_connection(
396 (self.proxy_server.host, self.proxy_server.port)
397 )
398 with self.client_context.wrap_socket(
399 sock, server_hostname="localhost"
400 ) as proxy_sock:
401 with SSLTransport(
402 proxy_sock, self.client_context, server_hostname="localhost"
403 ) as destination_sock:
404 assert destination_sock.version() is not None
405 destination_sock.send(sample_request())
406 response = consume_socket(destination_sock)
407 validate_response(response)
408
409 @pytest.mark.timeout(PER_TEST_TIMEOUT)
410 def test_wrong_sni_hint(self) -> None:

Callers

nothing calls this directly

Calls 9

start_proxy_serverMethod · 0.95
SSLTransportClass · 0.90
consume_socketFunction · 0.90
sample_requestFunction · 0.85
validate_responseFunction · 0.85
wrap_socketMethod · 0.80
versionMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected