“There was a bad response from the server” (NSURLErrorDomain -1011) on Mac

The server answered, but the answer was an error status or was not valid. The cause is often an error on the server, a wrong key or a proxy.

Fix this with your agentCopies a prompt for Claude Code, Codex or any agent that can use Terminal.

My Mac has this problem: “There was a bad response from the server” (NSURLErrorDomain -1011) on Mac. Read https://kilobat.app/guides/nsurl-error-1011-there-was-a-bad-response-from-the-server.md and work through it with me. Install the Kilobat CLI if it’s missing: brew install seifip/kilobat/kilobat. Run the guide’s Terminal and kilobat checks yourself and tell me what you find. List the steps only I can do. Ask before you change any setting.

Applies to: macOS 13 Ventura and later. The text was checked in CFNetwork on macOS 27.2.Checked: 29 October 2026

Symptoms

  • An app shows “There was a bad response from the server.”
  • Console shows NSURLErrorDomain Code=-1011.
  • The app can show a status such as 401, 403 or 500.

Likely causes

  • An HTTP error status. The server answered 4xx or 5xx.
  • A wrong login, key or token. The server refuses the request.
  • A proxy or filter page. A device on the network sends its own answer.
  • A server fault. The service has an error or a limit.

How to check

  1. Show the status code that the server sends.

    curl -sS -o /dev/null -w '%{http_code}\n' https://example.com
  2. Request the page and show each step of the connection.

    curl -v -o /dev/null https://example.com

How to fix it

  1. Read the status. 401 and 403 mean a login or key problem. 5xx means a server problem.

  2. Sign in again, or renew the key or token in the app.

  3. Try another network to rule out a proxy or filter.

  4. Try again later. If it keeps failing, tell the service owner.

With Kilobat

  1. Check Wi-Fi, the router, the internet, DNS and login pages in one step.

    kilobat diagnose
  2. If one site or service fails, find the layer that stops it.

    kilobat why example.com
  3. The CLI is free. In the app, the advice from these checks is part of Kilobat Pro. See Find why one site or API won't connect.

Questions

Is the Mac at fault?

Rarely. The server sent an answer that the app did not accept.

Does -1011 mean a network failure?

No. The network worked. The answer was bad.

Sources

  • Error text in CFNetwork.framework, macOS 27.2 (Localizable.loctable)
  • curl(1) and nc(1), man page installed with macOS 27.2

Checked on 29 October 2026.