---
title: "TLS Passthrough vs Termination: What a Proxy Sees"
description: "A TLS passthrough proxy sees the host, SNI, IPs, byte counts, and timing, never URLs, headers, or bodies. What each mode exposes, and how to check it yourself."
canonical: https://fixedmark.com/blog/tls-passthrough-zero-knowledge-proxy
updated: 2026-11-10
source: Fixedmark (https://fixedmark.com), BitMask LLP
---

Networking · 10 min read

# TLS Passthrough vs Termination: What a Proxy Sees

A passthrough proxy relays your TLS session byte for byte. It sees the destination host and port, the SNI, your IP and the destination's, byte counts, and timing, but never URLs, headers, or bodies. A terminating proxy decrypts the session with its own certificate, which your client accepts only if you trust that proxy's CA. Compare the certificate your client receives with and without the proxy to tell them apart.

## Passthrough and termination, side by side

A proxy handles TLS in one of two ways. In passthrough, the TLS session runs from your client to the destination server, and the proxy copies encrypted bytes in both directions. In termination, the proxy completes a TLS handshake with your client using a certificate it generated, decrypts everything, and opens a second TLS session to the destination.

HTTP CONNECT is the standard way to ask for passthrough. [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110#name-connect) says that once the tunnel is up, the proxy restricts itself to blind forwarding of data, in both directions, until the tunnel closes. SOCKS5 behaves the same way for any TCP stream. The byte-level exchange is covered in [how an HTTP CONNECT proxy works](https://fixedmark.com/blog/http-connect-proxy-explained).

_TLS passthrough compared with TLS termination at a proxy_

| Question                          | Passthrough                                    | Termination                          |
| --------------------------------- | ---------------------------------------------- | ------------------------------------ |
| Who holds the session keys        | Your client and the destination only           | The proxy, for both sessions         |
| Certificate your client sees      | The destination's real certificate             | One the proxy signed with its own CA |
| Proxy reads URLs, headers, bodies | No                                             | Yes                                  |
| Proxy can change requests         | No. Altered bytes fail the TLS integrity check | Yes                                  |
| Extra CA in your trust store      | Not needed                                     | Required, or the handshake fails     |
| Client certificates (mTLS)        | Reach the destination                          | End at the proxy                     |

There is a third arrangement worth naming. An `https://` proxy URL means your client opens TLS to the proxy first and sends the CONNECT request inside it. That outer session terminates at the proxy, which is the point, because it protects your proxy credentials. Your own TLS session to the destination still runs inside it, untouched. [HTTPS proxy endpoints](https://fixedmark.com/blog/https-proxy-endpoints-tls-to-the-proxy) covers which clients support this.

## What a passthrough proxy can see

Zero-knowledge describes the content, not the connection. A passthrough proxy still has to know where to send your bytes, and it sits on the network path, so it learns a fair amount.

- Your client's IP address, from the TCP connection it accepted.
- The destination host and port. A CONNECT request names them in plain text, such as `CONNECT api.example.com:443`, and a SOCKS5 request does the same.
- The destination IP, because the proxy usually resolves the name and opens the upstream connection itself.
- The SNI. [RFC 6066](https://www.rfc-editor.org/rfc/rfc6066#section-3) puts the server's DNS host name in the ClientHello, which travels unencrypted. It is almost always the same name as the CONNECT target.
- The rest of the ClientHello, which includes the TLS versions and cipher suites your client offers and its ALPN list (`h2`, `http/1.1`). Together these fingerprint your TLS library.
- Bytes sent and received, connection duration, and the size and timing of each TLS record.
- Which credential opened the tunnel, if the proxy requires authentication.

TLS version matters for one more item. In TLS 1.2 the server's certificate crosses the wire in clear text, so a passthrough proxy can read it. [RFC 8446](https://www.rfc-editor.org/rfc/rfc8446) changed that for TLS 1.3, where all handshake messages after the ServerHello are encrypted, including the certificate and the server's ALPN choice. (TLS 1.3 has since been revised as [RFC 9846](https://www.rfc-editor.org/rfc/rfc9846).)

## What stays hidden, and the exceptions

Inside a passthrough tunnel the proxy cannot read the HTTP method, the path, the query string, any request or response header, cookies, the body, or the response status. Your `Authorization: Bearer` header and the API key in your JSON body are ciphertext to it. If the proxy flips a byte, the record fails authentication and the connection errors out. It can drop, delay, or reset a connection. It cannot forge one.

That guarantee holds only when the bytes are TLS and your client checks them. Four cases break it.

1. Plain `http://` destinations. The client sends the whole request to the proxy in absolute form, such as `GET http://example.com/`, so the proxy reads everything. There is no tunnel to pass through.
2. Non-TLS TCP through SOCKS5 or CONNECT. A Postgres connection without TLS, or Redis on port 6379 with no TLS, is plain text to any hop on the path. Turn on the database's own TLS. See [database connections through SOCKS5](https://fixedmark.com/blog/database-connections-through-socks5-pooling).
3. A client that skips certificate checks. `verify=False` in Python requests, `NODE_TLS_REJECT_UNAUTHORIZED=0` in Node, `InsecureSkipVerify: true` in Go, and `curl -k` all let a terminating proxy impersonate the server without an error.
4. Traffic analysis. [RFC 8446 Appendix E.3](https://www.rfc-editor.org/rfc/rfc8446#appendix-E.3) says TLS is susceptible to traffic analysis based on the length and timing of encrypted packets. TLS 1.3 lets endpoints pad records to blunt this. A tunnel to a payouts API that opens at 09:15 every weekday and uploads the same number of bytes tells an observer something, even with no plaintext.

Databases add a wrinkle for logging. With default settings the Postgres client sends Postgres's own SSLRequest message before any TLS bytes, per the [PostgreSQL protocol docs](https://www.postgresql.org/docs/current/protocol-flow.html). A proxy that reads SNI from the first bytes of a stream finds no ClientHello there, so database rows in a proxy log often have no SNI.

## Encrypted Client Hello does not hide the destination from your proxy

Encrypted Client Hello, now [RFC 9849](https://www.rfc-editor.org/rfc/rfc9849), encrypts the real ClientHello, including the SNI and ALPN list, inside an outer ClientHello. The outer one carries a public name for the provider instead of the real host. That hides the host name from on-path observers, such as your ISP or a hotel network.

It does not hide anything from a forward proxy you chose. Your client already told the proxy the host and port in the CONNECT line or the SOCKS5 request, before any TLS started. The proxy then resolved that name to connect upstream. ECH protects the SNI field. The CONNECT target sits outside TLS entirely.

SOCKS5 gives you one small lever. With `socks5://`, many clients resolve the name locally and send only an IP, so the request no longer names the host, although the SNI in the ClientHello usually still does. With `socks5h://` the proxy resolves the name. [SOCKS5 vs socks5h](https://fixedmark.com/blog/socks5-vs-socks5h-dns-resolution) covers which clients do what. For an allowlisted API the destination is no secret anyway, since the partner already knows who calls them.

## A 70-line proxy that logs everything it can see

The quickest way to believe the list above is to run a passthrough proxy that tries its hardest to log. This one accepts CONNECT, relays bytes, parses the SNI from the first chunk the client sends, and prints one JSON line per tunnel. It uses only the Python standard library.

**peek_proxy.py**

```python
# A CONNECT proxy that logs everything a passthrough proxy can see.
# Python 3.10+. Run: python3 peek_proxy.py
import asyncio, json, struct, time

def sni_from_client_hello(data: bytes) -> str | None:
    """Return the server_name from a TLS ClientHello, or None."""
    try:
        if data[0] != 0x16 or data[5] != 0x01:  # handshake record, ClientHello
            return None
        p = 9 + 2 + 32                          # headers, version, random
        p += 1 + data[p]                        # session id
        p += 2 + struct.unpack(">H", data[p:p + 2])[0]  # cipher suites
        p += 1 + data[p]                        # compression methods
        end = p + 2 + struct.unpack(">H", data[p:p + 2])[0]
        p += 2
        while p + 4 <= end:
            ext_type, ext_len = struct.unpack(">HH", data[p:p + 4])
            p += 4
            if ext_type == 0:                   # server_name extension
                name_len = struct.unpack(">H", data[p + 3:p + 5])[0]
                return data[p + 5:p + 5 + name_len].decode("ascii")
            p += ext_len
    except (IndexError, struct.error, UnicodeDecodeError):
        pass
    return None

async def pipe(reader, writer, counter, key):
    try:
        while chunk := await reader.read(65536):
            counter[key] += len(chunk)
            writer.write(chunk)
            await writer.drain()
    finally:
        writer.close()

async def handle(client_r, client_w):
    started = time.monotonic()
    head = await client_r.readuntil(b"\r\n\r\n")
    method, target, _ = head.split(b"\r\n")[0].decode().split(" ")
    if method != "CONNECT":
        client_w.write(b"HTTP/1.1 405 Method Not Allowed\r\n\r\n")
        client_w.close()
        return
    host, port = target.rsplit(":", 1)
    up_r, up_w = await asyncio.open_connection(host, int(port))
    client_w.write(b"HTTP/1.1 200 Connection Established\r\n\r\n")
    await client_w.drain()

    first = await client_r.read(65536)          # the ClientHello, in the clear
    up_w.write(first)
    counts = {"up": len(first), "down": 0}
    await asyncio.gather(
        pipe(client_r, up_w, counts, "up"),
        pipe(up_r, client_w, counts, "down"),
        return_exceptions=True,
    )
    print(json.dumps({
        "client": client_w.get_extra_info("peername")[0],
        "connect": target,
        "dest_ip": up_w.get_extra_info("peername")[0],
        "sni": sni_from_client_hello(first),
        "bytes_up": counts["up"],
        "bytes_down": counts["down"],
        "duration_ms": round((time.monotonic() - started) * 1000),
    }), flush=True)

async def main():
    server = await asyncio.start_server(handle, "127.0.0.1", 8888)
    async with server:
        await server.serve_forever()

asyncio.run(main())
```

Start it, then send a request with a secret in the path and the query string.

**Terminal**

```bash
curl -s -o /dev/null -x http://127.0.0.1:8888 \
  "https://example.com/accounts/4711/statement?token=abc123"

# peek_proxy.py prints:
{"client": "127.0.0.1", "connect": "example.com:443", "dest_ip": "172.66.147.243", "sni": "example.com", "bytes_up": 1947, "bytes_down": 6424, "duration_ms": 26}
```

The account number, the path, and `token=abc123` appear nowhere in the output, and no change to this code can make them appear. They exist only inside the TLS session, and the keys for it never leave curl and the server. The fields it did print are the same kind of metadata any passthrough proxy service can log. The demo is for learning only. It has no authentication, timeouts, or limits. For what a production version needs, see [building a static IP proxy in Rust](https://fixedmark.com/blog/building-a-static-ip-proxy-in-rust).

## How to verify a proxy is not decrypting your traffic

You do not have to take a vendor's word for passthrough. A terminating proxy has to present a certificate it made, and your client can see that. Run these checks with the same proxy URL your app uses.

1. 1

   **Read the issuer in curl -v** Run `curl -v` through the proxy and find the `Server certificate` block. The issuer should be a public CA you recognise, the same one you see without the proxy. A terminating proxy shows its own CA there. [mitmproxy's docs](https://docs.mitmproxy.org/stable/concepts/how-mitmproxy-works/) describe the method, which generates interception certificates on the fly and only works once the client trusts mitmproxy's CA.
2. 2

   **Compare fingerprints with and without the proxy** Fetch the leaf certificate directly and through the proxy, and compare the SHA-256 fingerprints. `openssl s_client -proxy` sends a CONNECT for you, as the [OpenSSL manual](https://docs.openssl.org/3.0/man1/openssl-s_client/) documents. The manual warns that credentials passed with `-proxy_user` are easy to sniff, so use a short-lived test token if the proxy needs one. Large CDNs can serve different certificates from different edges, so if the fingerprints differ, compare the issuer and the subject before you conclude anything.
3. 3

   **Pin the public key** `curl --pinnedpubkey` takes base64 SHA-256 hashes prefixed with `sha256//`, per the [curl manual](https://curl.se/docs/manpage.html). If anything in the path swaps the certificate, curl exits with code 90 and prints `SSL: public key does not match pinned public key`. Pins break when the server rotates its key, so use this as a test, not in production code without a backup pin.
4. 4

   **Audit the client side** Check that your trust store holds no CA you did not add on purpose, and search your code for the verification bypasses listed above. A static IP proxy has no reason to ask you to install a CA certificate. If one does, it is terminating.

**curl**

```bash
# The issuer should match a direct request to the same host.
curl -sv -o /dev/null --proxy "$PROXY_URL" https://api.github.com/zen 2>&1 \
  | grep -E "> CONNECT|subject:|issuer:"
# > CONNECT api.github.com:443 HTTP/1.1
# *   subject: CN=*.github.com
# *   issuer: C=GB; O=Sectigo Limited; CN=Sectigo Public Server Authentication CA DV E36
```

**openssl**

```bash
H=api.github.com

# Direct
openssl s_client -connect $H:443 -servername $H </dev/null 2>/dev/null \
  | openssl x509 -noout -fingerprint -sha256

# Through a plain HTTP CONNECT proxy
openssl s_client -proxy proxy.example.com:8080 \
  -connect $H:443 -servername $H </dev/null 2>/dev/null \
  | openssl x509 -noout -fingerprint -sha256
```

**Key pin**

```bash
H=api.github.com

# Hash the server's public key, fetched directly.
PIN=$(openssl s_client -connect $H:443 -servername $H </dev/null 2>/dev/null \
  | openssl x509 -pubkey -noout \
  | openssl pkey -pubin -outform der \
  | openssl dgst -sha256 -binary | openssl enc -base64)

# Fails with exit code 90 if the proxy presents a different key.
curl -sS -o /dev/null --proxy "$PROXY_URL" \
  --pinnedpubkey "sha256//$PIN" https://$H/zen && echo "key matches"
```

If any check fails, [proxy error codes explained](https://fixedmark.com/blog/proxy-error-codes-explained) helps you tell a TLS problem from an authentication or routing problem.

## When termination is the right tool

Termination is not wrong. It is the right design when someone legitimately needs the plaintext.

- Reverse proxies and load balancers in front of your own servers. You own both ends and want routing by path, header rewrites, or a WAF.
- Corporate inspection, where the company installs its CA on managed laptops and accepts the trade.
- Debugging. mitmproxy or a similar tool on your own machine shows exactly what your code sends.

A static egress IP is not one of these. The partner allowlists your source address, and a passthrough proxy supplies that without reading a byte. Termination there would add risk and buy nothing. The proxy would hold plaintext bank and payment traffic, so a breach of it becomes a breach of every customer. It would break certificate pinning. It would also break mutual TLS, which some bank and partner APIs require. Your client certificate would authenticate you to the proxy, not to the partner, and the proxy would need its own copy of your key to go further.

An IP allowlist and end-to-end TLS work as layers that do not depend on each other. [IP allowlists in a zero trust world](https://fixedmark.com/blog/ip-allowlists-in-a-zero-trust-world) covers how they combine with mTLS and signed requests.

## Doing this with Fixedmark

Fixedmark is a static IP proxy in early access. It passes TLS through. Per the [security page](https://fixedmark.com/security), HTTP CONNECT and SOCKS5 relay your TLS connection byte for byte, and the proxy never holds your destination's certificate keys. It cannot read requests, responses, headers, or bodies, and no content is logged on any plan.

Here is what it does keep, in the same terms as the list above. The security page lists only connection metadata, never content: time, your client IP, destination host and port, TLS SNI, bytes sent and received, the egress IP used, and the result. A row in your [connection logs](https://fixedmark.com/docs/logs) holds `at`, `direction`, `dest_host`, `dest_port`, `sni` (when the client sent one), `bytes_up`, `bytes_down`, `duration_ms`, `egress_ip`, `result`, `reason`, and a `credential_id` that names the credential, never the token. Rows hold metadata only, are kept for your plan's retention, and are then deleted. Fixedmark's operational logs keep connection metadata for 30 days to run and secure the service.

- The proxy URL is `https://` on port 443, and SOCKS5 over TLS is on port 1443. That outer TLS ends at Fixedmark and protects your token. Your own TLS session runs inside it, unchanged.
- Ports 8080 (HTTP) and 1080 (SOCKS5) are plain. They exist for clients that cannot open TLS to a proxy, and they send the token in clear text. Your HTTPS traffic inside stays encrypted either way.
- An `http://` destination is forwarded as a plain request, as with any proxy. Use HTTPS destinations.
- Each token can carry a [destination allowlist](https://fixedmark.com/docs/allowlists), so a leaked token reaches only the hosts you named.

The checks above apply the same way. Set `PROXY_URL` to your Fixedmark proxy URL, run the curl and key pin tabs against your partner's host, and confirm the issuer is the partner's CA. Then confirm the egress address with [verify your egress IP](https://fixedmark.com/docs/verify-egress-ip). The [concepts page](https://fixedmark.com/docs/concepts) explains the two TLS layers in more detail.

## Sources

Checked November 2026. Confirm current details on the vendor's site before you decide. Prices and limits change.

- [RFC 9110: HTTP Semantics, CONNECT](https://www.rfc-editor.org/rfc/rfc9110#name-connect)
- [RFC 8446: The TLS Protocol Version 1.3](https://www.rfc-editor.org/rfc/rfc8446)
- [RFC 9846: TLS 1.3 (revised)](https://www.rfc-editor.org/rfc/rfc9846)
- [RFC 6066: TLS extensions, Server Name Indication](https://www.rfc-editor.org/rfc/rfc6066#section-3)
- [RFC 9849: TLS Encrypted Client Hello](https://www.rfc-editor.org/rfc/rfc9849)
- [mitmproxy: How mitmproxy works](https://docs.mitmproxy.org/stable/concepts/how-mitmproxy-works/)
- [curl: man page, --pinnedpubkey](https://curl.se/docs/manpage.html)
- [OpenSSL: openssl-s_client manual](https://docs.openssl.org/3.0/man1/openssl-s_client/)
- [PostgreSQL: Message flow, SSL session encryption](https://www.postgresql.org/docs/current/protocol-flow.html)

Keep reading

## Related guides

- [Guide Fixedmark security Zero-knowledge passthrough, what connection metadata is logged, and for how long.](https://fixedmark.com/security)
- [Use case Bank and UPI APIs Whitelist one dedicated IP pair with your bank, UPI partner bank, or GSP, then deploy on Vercel or Railway without re-whitelisting.](https://fixedmark.com/use-cases/bank-and-upi-apis)
- [Use case Payment gateway APIs Whitelist one IP pair for RazorpayX and Cashfree payouts, or lock Stripe keys to it, then deploy anywhere.](https://fixedmark.com/use-cases/payment-gateway-apis)
- [Guide Fixedmark docs Proxy URLs, protocols, and client guides for every language.](https://fixedmark.com/docs)

## Frequently asked questions

### Can a TLS passthrough proxy see my API keys?

Not if they travel in headers, query strings, or bodies of an HTTPS request. Those are inside the TLS session. The proxy does see its own proxy credentials, and it sees everything in a request to a plain http\:// URL.

### Is SOCKS5 passthrough too?

Yes. A SOCKS5 proxy connects to the host and port you ask for and relays bytes. If the stream is TLS, the proxy sees the same metadata as with CONNECT. If the stream is plain, such as a database without TLS, the proxy can read it.

### Does HTTP/2 change what the proxy sees?

It makes the proxy see less per request. HTTP/2 sends many requests over one TLS connection, so the proxy sees one tunnel and one SNI for all of them. It can still see total bytes and timing, but not where one request ends and the next begins with any certainty.

### Does zero-knowledge mean the proxy keeps no logs?

No. Zero-knowledge means the proxy cannot read content. It still knows connection metadata such as the destination, SNI, byte counts, and timing, and most providers log some of it. Read the provider's security page for the exact fields and retention.

### Can a passthrough proxy modify my traffic?

It cannot change it undetected. TLS authenticates every record, so altered bytes make the handshake or the next record fail and the connection closes with an error. A proxy can still delay, drop, or reset connections.
