Support transparent TLS interception on HTTP proxy port

Open
#2,786 8 comments 0 reactions 1 assignee View on GitHub

@NghiaTranUIT is already working on this.

Since Oct 7, 2026.

Assessment

This issue has not been assessed yet.

Description

✅ Done enhancement

Description

This was noticed when using https://github.com/httptoolkit/frida-interception-and-unpinning. Using it with Proxyman (with and without SOCKS) doesn't work (related: https://github.com/httptoolkit/frida-interception-and-unpinning/issues/126). This feature request focuses on the non-SOCKS case since it's significantly simpler and can be tested more representatively without Frida (after getting pcaps of the SOCKS case I still have no idea what the issue is).

I vibed out a repro Python script (stdlib only, tested on Python 3.14):

#!/usr/bin/env python3
"""Repro: transparent HTTPS interception (no proxy protocol) a la
httptoolkit/frida-interception-and-unpinning with PROXY_SUPPORTS_SOCKS5=false.

What the Frida scripts do in transparent mode: rewrite the socket destination
to the proxy's host:port and then speak *normal* HTTP/TLS, as if talking
directly to the origin. The proxy is expected to sniff Host/SNI and MITM.
HTTP Toolkit handles this on its port. This script checks whether the proxy
under test does too.

Usage:
    python3 proxyman-transparent-repro.py --proxy 127.0.0.1 --port 9090
    python3 proxyman-transparent-repro.py --proxy 127.0.0.1 --port 8000

Exit code 0 = transparent HTTP+HTTPS both work (agent target state).
Exit code 1 = transparent interception unsupported/broken.

For HTTPS to be MITM'd (rather than blind-tunneled), enable SSL Proxying /
decryption for example.com in the proxy under test first.
"""

import argparse
import socket
import ssl
import sys

SNI = "example.com"
TIMEOUT = 10


def check_plain_http(host, port):
    """Origin-form HTTP request straight at the proxy port (transparent)."""
    try:
        s = socket.create_connection((host, port), timeout=TIMEOUT)
        s.sendall(
            f"GET / HTTP/1.1\r\nHost: {SNI}\r\n"
            "User-Agent: transparent-repro/1.0\r\n"
            "Connection: close\r\n\r\n".encode()
        )
        resp = b""
        while True:
            chunk = s.recv(65536)
            if not chunk:
                break
            resp += chunk
        s.close()
        head = resp.split(b"\r\n", 1)[0] if resp else b"<empty>"
        ok = head.startswith(b"HTTP/1.1 200") or head.startswith(b"HTTP/1.0 200")
        return ok, f"first line: {head!r} ({len(resp)} bytes total)"
    except Exception as e:
        return False, f"{type(e).__name__}: {e}"


def check_transparent_tls(host, port):
    """Raw TLS ClientHello with SNI straight at the proxy port (transparent).

    No CONNECT, no SOCKS handshake - exactly what the Frida connect hooks
    produce. Expects the proxy to MITM with its own CA-issued cert.
    """
    try:
        raw = socket.create_connection((host, port), timeout=TIMEOUT)
        ctx = ssl.create_default_context()
        ctx.check_hostname = False
        ctx.verify_mode = ssl.CERT_NONE
        # SNI = example.com lets a transparent proxy route + forge the cert.
        tls = ctx.wrap_socket(raw, server_hostname=SNI)
        info = tls.getpeercert() or {}
        issuer = dict(x[0] for x in info.get("issuer", []))
        issuer_cn = issuer.get("commonName", issuer) if isinstance(issuer, dict) else issuer
        der = tls.getpeercert(binary_form=True)
        if not der:
            tls.close()
            return False, "handshake ok but peer presented no certificate"
        tls.sendall(
            f"GET / HTTP/1.1\r\nHost: {SNI}\r\n"
            "User-Agent: transparent-repro/1.0\r\n"
            "Connection: close\r\n\r\n".encode()
        )
        resp = b""
        while True:
            try:
                chunk = tls.recv(65536)
            except ssl.SSLError:
                break
            if not chunk:
                break
            resp += chunk
        tls.close()
        head = resp.split(b"\r\n", 1)[0] if resp else b"<empty>"
        ok = head.startswith(b"HTTP/1.1 200") or head.startswith(b"HTTP/1.0 200")
        return ok, f"issuer_cn={issuer_cn} first line: {head!r} ({len(resp)} bytes total)"
    except Exception as e:
        return False, f"{type(e).__name__}: {e}"


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument("--proxy", default="127.0.0.1")
    ap.add_argument("--port", type=int, required=True)
    args = ap.parse_args()

    print(f"Transparent interception repro against {args.proxy}:{args.port} (SNI/host={SNI})")
    results = []

    ok, detail = check_plain_http(args.proxy, args.port)
    results.append(ok)
    print(f"[{'PASS' if ok else 'FAIL'}] transparent plain HTTP : {detail}")

    ok, detail = check_transparent_tls(args.proxy, args.port)
    results.append(ok)
    print(f"[{'PASS' if ok else 'FAIL'}] transparent TLS+HTTP   : {detail}")

    if all(results):
        print("RESULT: PASS - transparent interception works")
        return 0
    print("RESULT: FAIL - transparent interception unsupported/broken")
    return 1


if __name__ == "__main__":
    sys.exit(main())

HTTP Toolkit:

Transparent interception repro against 127.0.0.1:8000 (SNI/host=example.com)
[PASS] transparent plain HTTP : first line: b'HTTP/1.1 200 OK' (931 bytes total)
[PASS] transparent TLS+HTTP   : issuer_cn={} first line: b'HTTP/1.1 200 OK' (931 bytes total)
RESULT: PASS - transparent interception works

Proxyman:

Transparent interception repro against 127.0.0.1:9090 (SNI/host=example.com)
[PASS] transparent plain HTTP : first line: b'HTTP/1.1 200 OK' (931 bytes total)
[FAIL] transparent TLS+HTTP   : SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1082)
RESULT: FAIL - transparent interception unsupported/broken

Why this feature/change is important?

Using those Frida hooks allows proxying basically any iOS app, including Flutter apps, without any code changes. It's extremely useful but seemingly cannot be used with Proxyman currently (at least macOS v26.0.1).

Dominant language
No language data
Stars
7.1k
Forks
238
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ProxymanApp/Proxyman

All issues in ProxymanApp/Proxyman

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.