Skip to content
WebsiteHosting.com

concept Networks

HTTP CONNECT tunnel boundaries

A 2xx response to HTTP CONNECT establishes a tunnel, not encryption. The proxy knows the requested host and port; what it can read in the forwarded bytes depends on the protocol inside.

Latest recorded source check · P0102

What it means

A successful HTTP CONNECT response establishes a byte tunnel; it does not encrypt the bytes. In HTTP/1.1, a client first asks a proxy to connect to a destination, such as site.example:443. If the proxy returns a final 2xx status, the tunnel begins immediately after the response headers end.

The proxy knows the requested host and port because it received the CONNECT request. What it can read inside the tunnel is a separate question. If the client uses TLS to the destination, a proxy acting only as a relay forwards TLS bytes, not decrypted application content. If the client sends cleartext instead, CONNECT does nothing to conceal it.

Try it

Simulation: Start with status 200, traffic set to tls, 1,200 synthetic bytes, and scenario evidence provided. The result is 1,200 bytes forwarded: 200 establishes the tunnel, and the example stipulates that the client then sends that many bytes. No proxy is contacted.

HTTP CONNECT tunnel boundaries

Explain tunnel setup and the limits of proxy visibility after 2xx

Simulation
Modeled outcome: Tls

After successful CONNECT, forwarded bytes belong to the tunnel; inner TLS content is not plaintext at a relay.

HTTP CONNECT tunnel boundaries: synthetic scenario inputs
Replaces all inputs with the documented starting example and the indicated change. Reset restores the starting example.
Response boundary

HTTP/1.1 exchange

  1. Client → proxyCONNECT host:port
  2. Proxy → clientFinal status 200
  3. After headers1200 bytes in tunnel

Inside the tunnel

  1. Protocoltls
  2. Content at relayEncrypted application traffic

The empty line ends HTTP response headers. Subsequent bytes belong to the tunnel, not an HTTP response body.

Evaluated inputs

Required scenario evidence
provided
CONNECT final HTTP status
200 status code
Traffic after successful response
tls
Synthetic bytes sent after response
1200 bytes

HTTP/1.1 abstract final response; no real authentication, proxy policy, framing errors or TLS handshake.

About this model

The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.

Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.

  1. Change only the traffic to cleartext. The proxy still forwards 1,200 bytes. What changed is whether the application content is in plaintext at the relay, not whether the tunnel exists.
  2. Keep cleartext selected and change the status to 299. The result stays the same because 299 is still a 2xx response.
  3. Change the status to 403. The result is now 0 tunnel bytes forwarded. The selected traffic type and byte count are not evaluated: there is no tunnel in which to send them.

With otherwise valid inputs, setting the evidence to missing gives an unknown result, not a count of zero. A missing or invalid input, such as a fractional status code, gives an input error instead. Reset restores 200, tls, 1,200 bytes, and provided.

Where the HTTP response ends

For a successful HTTP/1.1 CONNECT, the empty line at the end of the response header section is the dividing line. Before that boundary, the client is reading the proxy's HTTP response. After it, the client is reading bytes from the tunnel. Even if the successful response contains Content-Length or Transfer-Encoding, the recipient must ignore those fields for framing. The example's 1,200 bytes are traffic sent after the response, not the length of an HTTP response body.

In the diagram, follow the final status to the header boundary before interpreting the byte count. The cleartext and TLS branches use the same forwarding count; only the stipulated inner protocol differs. The lab does not use a TLS success or certificate-validation control, so neither branch can establish authentication.

This distinction matters even when the count is zero. A 200 followed by no bytes means a tunnel was established but nothing was sent in the example. A 403 means no tunnel was established. Zero tunnel bytes does not mean the proxy sent no HTTP response.

In practice

When reading a proxy log, identify the final status of the CONNECT request first. A 2xx answers “Did the proxy establish the tunnel?” It does not answer “Did the client authenticate the service inside it?” For that, look for the client's TLS handshake and authentication result. If all you have is the CONNECT status, leave the inner result unknown.

Rejection also matters for the underlying HTTP/1.1 connection. RFC 9931 §8 requires a proxy client acting for an untrusted TCP client to wait for a successful 2xx before forwarding TCP payload, use Connection: close in the CONNECT request, or do both. A proxy server that rejects CONNECT must close the underlying connection rather than interpret further requests on it. It may disable that mitigation for a client it knows waits for 2xx. A rejection alone is not evidence that the connection can be reused.

The simulation does not perform a TLS handshake, apply a proxy policy, parse malformed messages, or test connection closure. Use the final CONNECT response to locate the forwarding boundary; use evidence from the protocol inside the tunnel to judge confidentiality and authentication.

Frequently asked questions

Editorial questions based on the listed sources and explicitly labeled local examples.

Is only status 200 successful?

Any 2xx response establishes the tunnel under HTTP CONNECT semantics.

Can the proxy see the target?

The CONNECT request target identifies the requested destination authority.

Does a failed response carry tunnel data?

No tunnel is formed. A rejected HTTP/1.1 CONNECT is not proof that the underlying connection can be reused: RFC 9931 specifies connection closure on rejection, with a limited exception for known compliant proxy clients.

Does a successful CONNECT establish origin authentication?

No. It establishes a byte tunnel. For TLS inside the tunnel, look separately for evidence of the client’s handshake and its authentication of the intended destination; this lab does not execute those checks.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. RFC 9110: HTTP Semantics

    §9.3.6. CONNECT requests a tunnel to a destination. A successful 2xx response establishes the tunnel immediately after the response header section; unsuccessful responses are not tunnels. Successful CONNECT responses do not use Content-Length or Transfer-Encoding to frame tunnel bytes. RFC 9112 specifies HTTP/1.1 message framing.

    Checked .

  2. RFC 9112: HTTP/1.1

    §6.3. For HTTP/1.1, the successful CONNECT tunnel starts after the response header section; the recipient must not use received Content-Length or Transfer-Encoding to frame the tunnel bytes.

    Checked .

  3. RFC 9931: Security Considerations for Optimistic Protocol Transitions in HTTP/1.1

    §6.2 and §8. CONNECT rejection requires connection closure under the server mitigation, with the specified exception for known compliant clients. A proxy client acting for an untrusted TCP client waits for 2xx or uses Connection: close, or both. WebSocket clients already wait for the handshake response.

    Checked .

Report an issue. Include the article URL and ID, not passwords or access keys.