# Troubleshooting

> Fix common Cloak Proxy problems: no traffic, locked HTTPS tunnels, untrusted certificates, lost internet, port 9090 in use and Bad Gateway errors.

Source: https://docs.subcloak.com/cloak-proxy/reference/troubleshooting/

Most problems with a debugging proxy come down to three questions: is the traffic reaching Cloak Proxy, can Cloak Proxy decrypt it, and can Cloak Proxy reach the server. This page starts with where to look, then goes through each problem with its cause and fix.

## Start here

### Ask the Doctor

(added in Cloak Proxy 0.3.0)

Choose **Tools › Doctor…**, click the stethoscope in the bottom bar, or right-click an app in the sidebar and choose **Why isn't** app **showing traffic?** The [Doctor](https://docs.subcloak.com/cloak-proxy/capture/doctor/) checks the macOS proxy, VPNs, the certificate, pinning, HTTP/3, apps that skip the proxy, recording, filters, muting and the Allow List, and lists each problem with its evidence and a button that fixes it. A red number next to the stethoscope counts the problems it found. Its **Connections** view shows every recent connection with its timings, including ones that failed before they became a request.

### Read the capture status

The capsule in the middle of the main window's toolbar shows the proxy's state and address, for example **Listening on 127.0.0.1:9090**. Hover over it for details, including whether this Mac's own traffic is captured.

| State | Dot | Meaning |
|---|---|---|
| **Listening on** the address | Green | Listening and recording. Apps and devices that use Cloak Proxy are captured; the bottom bar says whether this Mac's traffic is too. |
| **Paused ·** the address | Orange | Recording is paused (up to 0.4.1). Traffic still flows but isn't added to the list. |
| **Paused · traffic untouched** (added in Cloak Proxy 0.4.2) | Orange | Recording is paused. Traffic still flows, untouched: nothing is decrypted, no rules apply, nothing is added to the list. **Paused · still intercepting** when **Settings › General** says to keep intercepting. |
| **Not listening** | Red | The proxy couldn't start. Hover to see why, for example a port in use. |

The bottom bar of the window adds **macOS traffic on** or **macOS traffic off** (click it to switch), how many debugging tools are on, the row count, and **CA trusted** or **CA not trusted** for the certificate.

### Check the log

Cloak Proxy writes diagnostics, not traffic, to:

```text
~/Library/Logs/CloakProxy/cloak-proxy.log
```

It records each start (port, macOS proxy and certificate state), every change to the macOS proxy, proxy guard events, refused device connections, hosts that pin their certificates, and listener errors. Open it with:

```bash title="Terminal"
open -a Console ~/Library/Logs/CloakProxy/cloak-proxy.log
```

The log stays small (added in Cloak Proxy 0.5.1): at 10 MB it's renamed `cloak-proxy.log.1` and a new one starts. Cloak Proxy keeps three old logs (`.1` is the newest) and deletes the oldest, so the folder never holds more than about 40 MB. To send a log with a bug report, include `cloak-proxy.log` and `cloak-proxy.log.1`. On Linux the log is in `$XDG_STATE_HOME/cloakproxy/` (usually `~/.local/state/cloakproxy/`).

## No traffic appears

The list shows **Waiting for traffic**, or an app you're using is missing.

| Cause | Fix |
|---|---|
| The macOS proxy is off. | Click **Capture macOS Traffic** in the empty list, click **macOS traffic off** in the bottom bar, or press <kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>P</kbd>. See [macOS traffic](https://docs.subcloak.com/cloak-proxy/capture/macos-traffic/). |
| Recording is paused. | Press <kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>R</kbd> or choose **Proxy › Resume Recording**. |
| A filter or sidebar selection hides it. | Select **All Traffic** in the sidebar and clear the quick filter and the content filters. See [Filtering](https://docs.subcloak.com/cloak-proxy/inspect/filtering/). |
| **Allow List** is on. | Only requests matching an Allow List rule are recorded. Turn it off in **Tools**, or add a rule. See [Allow List](https://docs.subcloak.com/cloak-proxy/tools/allow-list/). |
| The host is on the **Bypass** list. | macOS sends it straight to the internet. Remove it in **Settings › Bypass**, then turn the macOS proxy off and on. |
| A VPN or configuration profile overrides proxy settings. | Cloak Proxy warns that macOS doesn't report the proxy as active. The [Doctor](https://docs.subcloak.com/cloak-proxy/capture/doctor/#vpns) names the connected VPN and offers **Set the proxy again**. Disconnect the VPN if it doesn't stick, or capture the app another way (below). |
| The app ignores the macOS proxy. | It appears under **Not using the proxy** in the sidebar. See [Apps that ignore the proxy](#apps-that-ignore-the-proxy). |
| The app uses HTTP/3 (QUIC, over UDP). | No proxy can see HTTP/3. The [Doctor](https://docs.subcloak.com/cloak-proxy/capture/doctor/#http3) lists apps with QUIC connections; capturing their domains makes most of them fall back to HTTPS over TCP. (added in Cloak Proxy 0.3.0) |
| A command-line tool doesn't use the macOS proxy. | Terminal programs read `http_proxy` and similar variables instead. Use **Open Configured Terminal** in Device & Runtime Setup. See [Terminal and runtimes](https://docs.subcloak.com/cloak-proxy/devices/terminal-and-runtimes/). |

## HTTPS shows as locked tunnels

Requests show only a host with a lock, and the inspector says **Encrypted HTTPS to** the host: "Cloak Proxy passed this connection through without reading it."

*[Screenshot: The inspector for an encrypted tunnel, with a lock, the message that Cloak Proxy passed the connection through without reading it, and buttons to enable SSL proxying for the host or for every domain from the app. An HTTPS connection Cloak Proxy didn't decrypt, with one-click fixes.]*

That's expected. Cloak Proxy only decrypts hosts and apps you choose. To decrypt:

1. Make sure the certificate is trusted (see the next section). The buttons are dimmed until it is.

2. Click **Enable only** the host in the inspector, or **Enable all domains from** the app. You can also right-click a domain or app in the sidebar, or add a pattern in **Settings › SSL Proxying**.

3. Use the app again. Cloak Proxy closes the host's open tunnels so the app reconnects, decrypted.

See [SSL proxying](https://docs.subcloak.com/cloak-proxy/capture/ssl-proxying/).

## The certificate isn't trusted

An orange banner says **Trust the Cloak Proxy certificate to decrypt HTTPS**, the bottom bar shows **CA not trusted**, or decrypted requests fail.

| Situation | Fix |
|---|---|
| Never installed on this Mac | Click **Install & Trust…** in the banner or in **Settings › Certificate**. macOS asks for your password. |
| Installed but the status still says **Not trusted** | Click **Check Again** in **Settings › Certificate**. If it stays untrusted, click **Re-install**. |
| After **Regenerate Certificate…** | Install the new certificate on this Mac and on every device and simulator again. |
| Status says **Set to Never Trust for SSL** (added in Cloak Proxy 0.5.1) | The certificate is set to Never Trust in Keychain Access. Click **Trust Again…**. See [Never Trust in Keychain Access](https://docs.subcloak.com/cloak-proxy/capture/certificate/#never-trust-in-keychain-access). |
| A browser or runtime with its own trust store (Firefox, Java, Node.js, Python) | Give it the certificate separately. See [Java and the JVM](https://docs.subcloak.com/cloak-proxy/devices/java-firefox-docker-flutter-electron/) and [Terminal and runtimes](https://docs.subcloak.com/cloak-proxy/devices/terminal-and-runtimes/). |

A failed request whose message starts with "TLS handshake with the client failed. The client probably doesn't trust the Cloak Proxy CA, or it pins certificates." means the app refused Cloak Proxy's certificate. If the app should trust it, fix trust as above. If it pins certificates, see [Apps that pin certificates](#apps-that-pin-certificates). See [Certificate](https://docs.subcloak.com/cloak-proxy/capture/certificate/).

## The Linux window is blank

(added in Cloak Proxy 0.5.1)

On some graphics drivers WebKitGTK, which draws Cloak Proxy's window on Linux, shows an empty or black window. With NVIDIA's own driver Cloak Proxy turns off the renderer that causes it (it sets `WEBKIT_DISABLE_DMABUF_RENDERER=1` for its window), unless you set that variable yourself.

If the window is still blank, or you use another driver, start it with the variable set:

```bash title="Terminal"
WEBKIT_DISABLE_DMABUF_RENDERER=1 cloak-proxy
```

If that fixes it, add the line `export WEBKIT_DISABLE_DMABUF_RENDERER=1` to `~/.profile` and [tell us](https://github.com/subcloak/cloak-proxy/issues) your graphics card and driver. If NVIDIA's driver draws the window fine without the workaround, `CLOAK_NVIDIA_WORKAROUND=0 cloak-proxy` keeps the renderer on. Meanwhile `cloak-proxy --browser` opens the same page in your default browser.

## The internet stops working

### After Cloak Proxy quit unexpectedly

While macOS traffic is captured, the system proxy points at Cloak Proxy. If Cloak Proxy stopped without cleaning up, apps would have nowhere to send traffic. Cloak Proxy guards against this:

- Quitting normally, `kill`, <kbd>Control</kbd> <kbd>C</kbd> in a terminal or closing the terminal it runs in all restore your previous proxy settings before it exits.
- A small helper, the **proxy guard** (`cloakctl proxy-guard`), watches the app while the macOS proxy is on. If the app disappears (Force Quit, a crash, a forced restart), it restores your previous settings within a few seconds, unless Cloak Proxy is already listening again. The log says "the proxy guard restored it".

If you're still offline:

1. Open Cloak Proxy and quit it with <kbd>⌘</kbd> <kbd>Q</kbd>. It restores the settings it saved.

2. If that doesn't help, open **System Settings › Network**, choose your connection (for example Wi-Fi), click **Details…**, open **Proxies**, and turn off **Web proxy (HTTP)** and **Secure web proxy (HTTPS)**.

   Or in Terminal, for Wi-Fi:

   ```bash title="Terminal"
   networksetup -setwebproxystate "Wi-Fi" off
   networksetup -setsecurewebproxystate "Wi-Fi" off
   ```

3. Check the log. "Couldn't start the proxy guard" or "No cloakctl next to the app" means the guard wasn't running; reinstall Cloak Proxy so `cloakctl` is back inside the app.

### On a phone or another device

A device whose Wi-Fi proxy points at your Mac can't reach the internet while Cloak Proxy isn't running or the Mac is asleep or on another network. Turn the proxy **Off** on the device, or open Cloak Proxy again. For Android over `adb`, click **Disconnect Proxy**.

## Port 9090 is in use

The toolbar shows **Not listening**, and hovering over it shows `Couldn't listen on port 9090: … Address already in use`.

1. Find what's using the port:

   ```bash title="Terminal"
   lsof -nP -iTCP:9090 -sTCP:LISTEN
   ```

2. If it's another Cloak Proxy (a second copy of the app, or `cloakctl run`), stop it. After you quit and reopen the app, it waits a few seconds for the old copy to free the port.

3. Otherwise, choose another port in **Settings › General › Port**, such as `9091`, and click **Apply & Restart Proxy**. Update any device or runtime that points at the old port.

The same applies to the **SOCKS5 proxy** and **Reverse proxies** ports on **Settings › Network**; their errors appear next to **Apply & Restart Proxy** there.

## macOS won't open the app the first time

Cloak Proxy 0.4.2 and later are signed with a Developer ID and notarized by Apple, so they open like any other app. If macOS says it can't verify the developer, you have 0.4.1 or older, which weren't notarized. [Download the current version](https://subcloak.com/apps/cloak-proxy), or open the old one once by hand: try to open it and dismiss the warning, then click **Open Anyway** next to the message about Cloak Proxy in **System Settings › Privacy & Security**, and enter your password if asked.

## Apps that ignore the proxy

Some apps and SDKs (some Electron apps, Firebase and gRPC clients, apps using raw sockets) connect straight to the internet. Cloak Proxy notices and lists them under **Not using the proxy** in the sidebar, with their direct connections.

| Option | When to use it |
|---|---|
| The capture sheet | Click the app under **Not using the proxy**. Cloak Proxy suggests its domains and points them at itself through `/etc/resolver`. macOS asks for your password. See [Apps that ignore the proxy](https://docs.subcloak.com/cloak-proxy/capture/apps-that-ignore-the-proxy/). |
| App Capture (added in Cloak Proxy 0.5.0) | From 0.5.0, with the Cloak Proxy download: sends every TCP connection of the apps you pick through Cloak Proxy, whatever the server. See [Capture apps that ignore the proxy](https://docs.subcloak.com/cloak-proxy/capture/capture-apps-that-ignore-the-proxy/). |
| A reverse proxy | When you can change the app's server URL: point it at `http://localhost:PORT` and set the target in **Settings › Network › Reverse proxies**. |
| Environment variables | Command-line tools: see [Terminal and runtimes](https://docs.subcloak.com/cloak-proxy/devices/terminal-and-runtimes/). |

Captured domains apply to every app on the Mac that uses them, and keep resolving while Cloak Proxy is closed, through a small background helper. Click **Stop Capturing** in the capture sheet to remove them.

## Apps that pin certificates

Some apps only accept their server's real certificate. Cloak Proxy can't decrypt them, and you'll see the "TLS handshake with the client failed" message, followed by the app failing to connect while the host is on your SSL Proxying list.

- Open the [Doctor](https://docs.subcloak.com/cloak-proxy/capture/doctor/#certificate-pinning). It lists the hosts each app refuses the certificate for and offers **Stop decrypting these hosts**, which removes them from SSL Proxying or adds them to **Never decrypted** in **Settings › SSL Proxying** when a wildcard or the app's own rule covers them. (added in Cloak Proxy 0.3.0)
- Or remove the host or app from SSL proxying yourself so its traffic passes through encrypted again.
- For a domain captured through the capture sheet, Cloak Proxy does this for you: it passes the pinned host through so the app keeps working, and the sheet lists it as **Pinned (passed through)**.
- For your own app, turn off pinning in debug builds. Don't try to defeat pinning in apps you don't own or aren't authorized to test.

## Sign-ins fail or a site asks you to verify you're human

A sign-in page says **This browser or app may not be secure** or hangs, or a site answers **403** with a "Verify you are human" check that never passes. The site checks the browser's connection, and Cloak Proxy decrypted it, so it saw Cloak Proxy's TLS fingerprint instead of the browser's.

- Turn SSL Proxying off for the browser, or for that host, and reload the page. See [Decrypting a browser](https://docs.subcloak.com/cloak-proxy/capture/ssl-proxying/#decrypting-a-browser).
- To inspect a browser, use the [Capturing Browser](https://docs.subcloak.com/cloak-proxy/devices/capturing-browser/) instead of SSL Proxying for your whole browser.
- From 0.4.2, pausing recording also works, because it passes traffic through untouched, and the [Doctor](https://docs.subcloak.com/cloak-proxy/capture/doctor/#bot-challenges-and-sign-ins) reports the host with **Stop decrypting**. Google, Apple Account, Microsoft and Okta sign-in hosts and Cloudflare's challenge host are never decrypted by default. (added in Cloak Proxy 0.4.2)

## Other devices can't connect

| Cause | Fix |
|---|---|
| **Allow other devices to connect** is off. | Turn it on in **Settings › General** and click **Apply & Restart Proxy**, or click **Allow Other Devices to Connect** in the iPhone & iPad setup. |
| The device's address isn't on **Allowed devices**. | Add it in **Settings › Network**, or empty the list. The log shows "Refused a connection from … not in the allowed client list". |
| Wrong address or port on the device | Use the address shown as **This Mac's address** in **Settings › General**, for example `192.168.1.20:9090`. |
| The device is on a different network | Put both on the same Wi-Fi. Guest networks often block devices from reaching each other. |
| The certificate page doesn't load | `http://cloak.proxy` only works once the device's proxy points at Cloak Proxy. You can also scan the QR code in **iPhone & iPad** setup. |

See [Other devices and access control](https://docs.subcloak.com/cloak-proxy/devices/other-devices-and-access-control/).

## iPhone and iPad

| Symptom | Fix |
|---|---|
| No traffic | In **Settings › Wi-Fi**, tap ⓘ next to your network, choose **Configure Proxy › Manual**, and enter your Mac's address and port. |
| HTTPS fails in every app | Installing the profile isn't enough. Also turn on full trust in **Settings › General › About › Certificate Trust Settings** for Cloak Proxy CA. |
| HTTPS fails after regenerating the certificate | Delete the old profile in **Settings › General › VPN & Device Management** and install the new one. |
| One app fails, others work | It may pin certificates. See [Apps that pin certificates](#apps-that-pin-certificates). |
| Nothing arrives although the Wi-Fi proxy is set (added in Cloak Proxy 0.5.1) | See [If nothing arrives](https://docs.subcloak.com/cloak-proxy/devices/iphone-and-ipad/#if-nothing-arrives): the Mac's firewall, Internet Sharing, a VPN or Private Relay on the device. |
| An app installed from Xcode says **Untrusted Developer** and **Verify App** fails | iPadOS and iOS check these apps with Apple's `ppq.apple.com`, which Cloak Proxy 0.4.0 and later never decrypt. On earlier versions, or if the check still fails, set the Wi-Fi proxy to **Off**, then in **Settings › General › VPN & Device Management** tap your developer app and **Trust** or **Verify App**. Turn the proxy back on afterwards. |

When you're done, remove the profile and set the Wi-Fi proxy back to **Off**. See [iPhone and iPad](https://docs.subcloak.com/cloak-proxy/devices/iphone-and-ipad/).

For the **iOS Simulator**: simulators use the Mac's proxy, so turn on macOS capture, then click **Install Certificate on All Booted Simulators** and restart the app in the simulator. This needs Xcode; if Cloak Proxy says `simctl` isn't installed, install Xcode and run `sudo xcode-select -s /Applications/Xcode.app`. See [iOS Simulator](https://docs.subcloak.com/cloak-proxy/devices/ios-simulator/).

## Android

| Symptom | Fix |
|---|---|
| The one-click buttons are missing | Cloak Proxy says `adb` wasn't found. Install Android platform tools, for example `brew install android-platform-tools`. |
| No traffic | Click **Connect Proxy**. It runs `adb reverse` and sets the device's proxy to `127.0.0.1` on your port. Click **Show Connected Devices** to check the device is listed. |
| HTTPS fails in your app | Apps targeting Android 7 or later ignore user-installed certificates unless their network security config trusts them. Add a `debug-overrides` block that trusts `user` certificates to your debug build. |
| The certificate isn't installed | Click **Push Certificate**, then on the device go to **Settings › Security › Encryption & credentials › Install a certificate › CA certificate**. |
| The device has no internet after debugging | Click **Disconnect Proxy**. |
| The device has no internet after you unplug it or restart adb (added in Cloak Proxy 0.5.1) | The `adb reverse` forward is gone. See [If the device loses its connection](https://docs.subcloak.com/cloak-proxy/devices/android/#if-the-device-loses-its-connection). |

See [Android](https://docs.subcloak.com/cloak-proxy/devices/android/).

## DNS problems

| Symptom | Cause and fix |
|---|---|
| A request fails with `DNS lookup for host failed: …` | The host name doesn't resolve. Check for typos and your network, or point the name at an address with [DNS Spoofing](https://docs.subcloak.com/cloak-proxy/tools/dns-spoofing/). Cloak Proxy checks DNS first so these fail at once instead of hanging. |
| A host resolves to the wrong server | Check **Tools › DNS Spoofing** for a rule you forgot, and `/etc/hosts`. |
| A captured domain behaves oddly | Domains captured for [apps that ignore the proxy](https://docs.subcloak.com/cloak-proxy/capture/apps-that-ignore-the-proxy/) resolve to Cloak Proxy for every app. Cloak Proxy looks up their real addresses from your network's DNS servers, falling back to `1.1.1.1` and `8.8.8.8`. Click **Stop Capturing** in the capture sheet to remove them. |
| "Couldn't update /etc/resolver" | Capturing needs your Mac password. Try again and enter it, or cancel to leave things as they were. |

## Bad Gateway and other failed requests

When Cloak Proxy can't complete a request, the app receives `502 Bad Gateway` with a plain-text body explaining why and an `X-Cloak-Proxy-Error: 1` header. The request appears as **Failed** in the list, and the inspector shows the reason above the request tabs and under **No response**. For an HTTPS tunnel that couldn't connect, the inspector says **Couldn't open a connection to** the host instead.

*[Screenshot: The inspector for a failed GET to does-not-exist.invalid: Failed in red, a DNS lookup error above the request tabs, and No response with the same message in the response pane. A failed request shows the reason in the inspector.]*

| Message | Meaning |
|---|---|
| `DNS lookup for api.example.com failed: …` | The host can't be resolved. See [DNS problems](#dns-problems). |
| `Could not connect to api.example.com:443: …` | The server refused the connection or is unreachable. Check the host, port, VPN and firewall. |
| `Timed out connecting to api.example.com` | No answer while connecting. |
| `Timed out waiting for a response from api.example.com` | Connected, but the server didn't answer in time. |
| `The request to api.example.com took longer than 5 minutes` | The whole request hit Cloak Proxy's 5-minute limit. |
| `Aborted at the request breakpoint` (or `response`) | You clicked **Abort** in the [Breakpoint](https://docs.subcloak.com/cloak-proxy/tools/breakpoint/) window. |

A server with a self-signed or otherwise invalid certificate (common on development and staging servers) fails certificate checks. To skip the check for specific hosts, add them to `insecureUpstreamHosts` with `update_settings` through the [control API](https://docs.subcloak.com/cloak-proxy/automation/control-api/) or MCP. Those requests are tagged **Insecure TLS**. Only do this for servers you control.

If requests fail only when an [external proxy](https://docs.subcloak.com/cloak-proxy/capture/network-settings/) is set, check its host, port and credentials in **Settings › Network**. From 0.4.2, the [Doctor](https://docs.subcloak.com/cloak-proxy/capture/doctor/#upstream-proxy) shows what the proxy answered (a 407 means it wants a username and password), and hosts on your own network may need to be under **Don't use it for**. (added in Cloak Proxy 0.4.2)

## cloakctl and MCP errors

| Message | Fix |
|---|---|
| `Couldn't reach Cloak Proxy on port 9090. Is the app (or cloakctl run) running?` | Open the app, or pass `--port N` if it listens elsewhere. |
| `Missing or wrong X-Cloak-Token` | The request didn't send the token from `~/Library/Application Support/CloakProxy/api-token`. See [Control API](https://docs.subcloak.com/cloak-proxy/automation/control-api/). |
| `The API is only available on this Mac` | The API refuses other machines by design. |
| `… needs the Cloak Proxy app; cloakctl run only serves the read API` | Open the app for anything beyond reading and replaying traffic. |
| `No collection named …` | Run `cloakctl collection list`, or pass `--workspace DIR`. |

## Related

  - [How it works](https://docs.subcloak.com/cloak-proxy/getting-started/how-it-works/): Proxies, tunnels, TLS interception and the proxy guard explained.
  - [Settings](https://docs.subcloak.com/cloak-proxy/reference/settings/): Every option and its default.
  - [Failed requests and tunnels](https://docs.subcloak.com/cloak-proxy/inspect/failed-requests-and-tunnels/): Read what the inspector says about failures.
  - [FAQ](https://docs.subcloak.com/cloak-proxy/reference/faq/): Short answers to common questions.
