On this page 10 sections
- What a 1005 looks like in each client
- What error 1005 means, from each side
- Which network Cloudflare is judging
- Causes, most common first
- 1. The request comes from a cloud or hosting network
- 2. A VPN, privacy relay or proxy exit
- 3. A corporate gateway or TLS-inspecting proxy
- 4. Your ISP or mobile carrier is the banned network
- 5. IPv6 leaves through a different network
- When it is not a 1005: proxy failures that look like a block
- Proxy authentication (407)
- CONNECT refused by the proxy (403)
- Upstream refusal (503 or 502)
- TLS interception
- A script that tells you who answered
- Fixing a 1005 as the site owner
- Other errors numbered 1005
- Cause-to-fix table
- How we tested
Error 1005
Ray ID: a4e2d060ce28d2d9 • 2026-10-21 19:54:24 UTC
Access denied
What happened?
The owner of this website (proxy.wiki) has banned the autonomous system number (ASN) your IP address is in (ASN redacted) from accessing this website.
That is Cloudflare error 1005 in full. The site’s owner told Cloudflare to refuse every visitor whose IP address belongs to one particular network, and your address is on it. Cloudflare’s documentation calls it “Access Denied: Autonomous System Number (ASN) banned” and its 1xxx status table pairs it with HTTP 403. Your browser is fine. Your cookies are fine. The decision is made on the address the connection arrives from, so nothing inside the request changes it.
A script sees a shorter version. With curl’s defaults the whole body is 17 bytes:
$ curl -sS -D - https://proxy.wiki/cdn-cgi/error/1005
HTTP/2 403
date: Wed, 21 Oct 2026 20:06:37 GMT
content-type: text/plain; charset=UTF-8
content-length: 17
[6 headers trimmed]
server: cloudflare
cf-ray: a4e2e243e83e6e9d-[colo]
error code: 1005
Every capture on this page was taken on one test machine on 21 October 2026. The 1005 responses come from /cdn-cgi/error/1005, a path Cloudflare answers on every zone it fronts, which its error-responses reference uses for testing error formats. We requested it on proxy.wiki’s own zone. That is Cloudflare’s real error renderer, not a mock, but no ASN rule fired, so read these captures as the exact shape of a 1005 rather than as a block anyone configured. The proxy failures further down come from Squid 6.13 running on 127.0.0.1. We redacted our own IP address, ASN and Cloudflare data-centre code.
If you are a visitor: you cannot clear a 1005 from your end. Send the site owner a screenshot showing the Ray ID and the UTC time, which is what Cloudflare itself advises. If you are on a VPN, a work network or a cloud server, one attempt from an ordinary home or mobile connection tells you whether the block follows the network.
What a 1005 looks like in each client
Cloudflare negotiates the format. In 2026 it began answering 1xxx errors as JSON that follows RFC 9457, or Markdown with YAML front matter, depending on the Accept header. The documentation does not mention the plain-text fallback shown above, so we tested for it. An 18-request matrix varied the User-Agent (curl, a made-up agent, Chrome), the Accept header and the presence of Accept-Encoding. A six-request follow-up isolated the rule. Cloudflare sent the 17-byte error code: 1005 whenever the request lacked either an Accept header or an Accept-Encoding header. With both present it honoured Accept. User-Agent changed nothing in this HTTP/2 run; HTTP/1.1 was not part of the captured matrix.
That rule decides what your tooling shows you. We captured the default headers each client sent to a local echo server, then pointed the same client at the 1005 page:
| Client | Version | Accept / Accept-Encoding sent by default | What came back |
|---|---|---|---|
| curl, macOS system build | 8.7.1 | */* / none |
403, text/plain, error code: 1005 |
| curl, Homebrew build | 8.23.0 | */* / none |
403, text/plain, error code: 1005 |
curl with --compressed |
8.7.1 | */* / deflate, gzip |
403, the HTML page |
| Python urllib | 3.15.0 | none / identity |
403, text/plain, error code: 1005 |
| Node fetch (undici) | 24.2.0 | */* / gzip, deflate |
403, JSON when we asked for application/json |
| Google Chrome, headless | 155.0.8059.85 | browser defaults | 403, page titled “Access denied | proxy.wiki used Cloudflare to restrict access” |
Python’s urllib is the odd one. It sends Accept-Encoding: identity but no Accept at all, and that alone is enough to get the plain-text body. Our survey of default request headers covers what other clients send before you configure anything.
| Format returned | Body size (bytes) |
|---|---|
| text/plain fallback | 17 |
| Markdown (Accept: text/markdown) | 577 |
| JSON (Accept: application/json) | 744 |
| HTML (Accept: */*) | 7204 |
The JSON version is the most useful one for code:
$ curl -s --compressed -H 'Accept: application/json' https://proxy.wiki/cdn-cgi/error/1005 | python3 -m json.tool
{
"type": "https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1005/",
"title": "Error 1005: Access denied",
"status": 403,
"detail": "The site owner has blocked the autonomous system number (ASN) associated with your IP address.",
"instance": "a4e2e3f95d207e5c",
"error_code": 1005,
"error_name": "asn_banned",
"error_category": "access_denied",
"ray_id": "a4e2e3f95d207e5c",
"timestamp": "2026-10-21T20:07:47Z",
"zone": "proxy.wiki",
"cloudflare_error": true,
"retryable": false,
"owner_action_required": true,
"what_you_should_do": "**Do not retry.** This block is intentional. Contact the site owner if you believe this is an error.",
"footer": "This error was generated by Cloudflare on behalf of the website owner."
}
Two things in it surprised us. First, neither the JSON nor the Markdown carries the ASN number. Only the HTML page names it, so when you need the number, ask for HTML and grep:
$ curl -s --compressed https://proxy.wiki/cdn-cgi/error/1005 | grep -o 'your IP address is in ([0-9]*)'
your IP address is in (ASN redacted)
Second, retryable is false and no Retry-After header was sent. Cloudflare’s 12 March 2026 changelog lists 1005 among seven codes that carry Retry-After: 120. On our zone, seven months later, 1015 came back with retry-after: 30 and 522 with retry-after: 120, while 1005 had none. Go by the response, not the changelog. A crawler that backs off and retries a 1005 every two minutes is retrying a block that a person put there on purpose.
What error 1005 means, from each side
An autonomous system number identifies a network that announces its own IP ranges on the internet: an ISP, a mobile carrier, a cloud provider, a university. Cloudflare maps the address of each incoming connection to the ASN that announces it, and the field is available to the site owner’s rules as ip.src.asnum.
For the visitor, the code says the block is about where you connect from. It is not about your account, your browser fingerprint or how fast you were going; those produce other codes or challenge pages. Cloudflare’s resolution for visitors is one line: send the site owner a screenshot of the error.
For the site owner, the code points at one tool. Cloudflare’s 1005 page sends owners to IP Access rules, which can target an IP, a range, a country or an ASN written like AS13335, and which are available on every plan, Free included, with up to 50,000 rules per account. A rule with the Block action on an ASN produces the 1005. The neighbouring codes map to the other targets: 1006, 1007 and 1008 are a banned IP address, 1009 a banned country or region. Cloudflare now recommends WAF custom rules over IP Access rules for this kind of blocking, and a request stopped by a custom rule does not get a 1xxx code at all. It gets the WAF block response, according to Cloudflare’s 1020 page and its notes on the firewall rules upgrade. So a 1005 in the wild usually means an IP Access rule, not a custom rule on ip.src.asnum.
Which network Cloudflare is judging
The ASN in the message belongs to whichever address opened the TCP connection to Cloudflare. Cloudflare passes that address to the origin as CF-Connecting-IP. When a proxy has already added an X-Forwarded-For header, Cloudflare appends the proxy’s address to it rather than trusting what the proxy wrote. Our local Squid added Via: 1.1 squid-bench.local (squid/6.13) and X-Forwarded-For: 127.0.0.1 to every plain-HTTP request it forwarded, and none of that changes which network a rule sees. Behind a VPN, a proxy or a company gateway, the network being judged is theirs.
Three commands find it. The first asks Cloudflare which address it sees, on any Cloudflare-fronted host. The second asks Team Cymru’s IP-to-ASN service who announces that address; the output below is for 1.1.1.1, a public example. The third makes Cloudflare name the ASN outright, because the HTML 1005 page fills in the number of whoever requests it.
$ curl -s https://proxy.wiki/cdn-cgi/trace | grep -E '^(ip|http|tls|warp|gateway)='
ip=[redacted]
http=http/2
tls=TLSv1.3
warp=off
gateway=off
$ whois -h whois.cymru.com " -v 1.1.1.1"
AS | IP | BGP Prefix | CC | Registry | Allocated | AS Name
13335 | 1.1.1.1 | 1.1.1.0/24 | AU | apnic | 2011-08-11 | CLOUDFLARENET - Cloudflare, Inc., US
$ curl -s --compressed https://proxy.wiki/cdn-cgi/error/1005 | grep -o 'your IP address is in ([0-9]*)'
your IP address is in (ASN redacted)
Add -x http://user:pass@gw.example.net:8000 to the first or third command to see what a proxy exit looks like to Cloudflare. Run them with -4 and then -6 if your network has IPv6, since the two address families can be announced by different networks, for example when IPv6 arrives through a tunnel. On our connection both families returned the same ASN.
Causes, most common first
We have no census of ASN bans. What we have is the public record of people who pasted the page into a bug tracker. Every report we found that named the network was a program running on rented servers. Four is not a sample anyone should generalise from, but it is consistent, and it matches who tends to run scripts.
| Public report | Year | Network in the report | ASN |
|---|---|---|---|
| firefly-proxy #46 | 2017 | AS-VULTR, The Constant Company | 20473 |
| gd.py #87 | 2023 | AMAZON-02, Amazon.com | 16509 |
| trakt-scrobbler #339 | 2025 | ORACLE-BMC-31898, Oracle | 31898 |
| monitor_ritapolis #33 | 2026 | Oracle Cloud, as stated by the author | — |
The network names come from a Team Cymru DNS lookup we ran on each number, for example dig +short TXT AS16509.asn.cymru.com.
1. The request comes from a cloud or hosting network
A hosting ASN is an easy rule to write. One entry covers every server a provider rents out, and few people browse from inside a data centre. The 2026 report above describes 194 consecutive attempts from an Oracle Cloud VM, all returning 403, while the same request from a non-datacenter address returned 200.
Diagnose: run the trace and Cymru commands on the server itself, not on your laptop. Names like AMAZON-02, ORACLE-BMC-31898 or HETZNER-AS mean this is your cause.
Fix: ask the owner for access and give them the server’s IP address with a Ray ID. Cloudflare documents that an IP Access rule’s Allow action takes precedence over Block, so the owner can let one address through without lifting the ASN ban. If the site publishes an API or a feed, use that. Do not wrap the request in a retry loop; the response itself says not to.
2. A VPN, privacy relay or proxy exit
The same mechanism, one step removed. Your traffic leaves from the provider’s network and the provider’s ASN is what gets judged. A datacenter proxy exits from hosting space by definition. Other exit types sit on ISP or carrier networks, which is a different ASN, not a different rule. If an owner banned a network deliberately, treat that as their answer and ask for access rather than routing around it.
Diagnose: run the trace command with the VPN off and on, or with and without -x. If the 1005 appears only on one side, the exit is the cause.
Fix: disconnect the VPN for that site or exclude it in the client’s split-tunnel settings. For a proxy you pay for, the block will follow that provider’s network to every site that bans it.
3. A corporate gateway or TLS-inspecting proxy
An inspecting proxy ends your TLS session and opens a new one to the site. The site sees the gateway’s address. We reproduced this with Squid’s ssl-bump. curl’s verbose output named our local CA as the issuer of proxy.wiki’s certificate, and Squid’s access log recorded the request it made on our behalf, with Cloudflare’s 403:
* subject: CN=proxy.wiki
* issuer: CN=Local test interception CA
< HTTP/1.1 403 Forbidden
< Server: cloudflare
1792612662.741 9 127.0.0.1 TCP_MISS/403 3087 GET https://proxy.wiki/cdn-cgi/error/1005 - HIER_DIRECT/104.21.91.68 text/html
Diagnose: curl -sv -o /dev/null https://example.com/ 2>&1 | grep issuer:. A public CA in that line means no inspection. Your employer’s CA name means your traffic is being re-originated. Without any interception, proxy.wiki’s certificate showed issuer: C=US; O=Google Trust Services; CN=WE1.
Fix: ask IT whether the site can go direct instead of through the gateway, or ask the site owner to allow the gateway’s published egress addresses.
4. Your ISP or mobile carrier is the banned network
IP Access rules accept any ASN, a consumer ISP’s included. If the number on the page resolves to the company that sells you broadband or mobile data, nobody on that network can reach the site. On mobile, carrier-grade NAT already means many subscribers share addresses, which is one reason an owner might reach for a network-wide rule in the first place.
Diagnose: read the number in parentheses and look it up. Fix: only the owner can, so send them the Ray ID and the time.
5. IPv6 leaves through a different network
If curl -4 and curl -6 against the trace endpoint give addresses from different ASNs, one family can be blocked while the other works. Browsers prefer IPv6 when it is available, so the failing path may be the one you never think about. Fix: report both addresses to the owner, and to your network administrator if the IPv6 route is unexpected.
When it is not a 1005: proxy failures that look like a block
Behind a proxy, a 403 can come from two different machines. For an https:// URL the client first sends CONNECT to the proxy, and only after 200 Connection established does TLS to the site begin. Cloudflare can only answer after that line. Anything before it came from the proxy. Here is our Squid refusing the tunnel, then the same Squid carrying Cloudflare’s real 1005 (curl 8.7.1, lines filtered with grep):
$ curl -sv -x http://127.0.0.1:31030 https://proxy.wiki/cdn-cgi/error/1005
> CONNECT proxy.wiki:443 HTTP/1.1
< HTTP/1.1 403 Forbidden
< Server: squid/6.13
< X-Squid-Error: ERR_ACCESS_DENIED 0
curl: (56) CONNECT tunnel failed, response 403
$ curl -sv -x http://127.0.0.1:31028 --compressed https://proxy.wiki/cdn-cgi/error/1005
> CONNECT proxy.wiki:443 HTTP/1.1
< HTTP/1.1 200 Connection established
* issuer: C=US; O=Google Trust Services; CN=WE1
* SSL certificate verify ok.
< HTTP/2 403
< server: cloudflare
< cf-ray: a4e2d4e05a43d0f7-[colo]
The quick test: a cf-ray header and server: cloudflare mean Cloudflare answered. A Server: squid or Via header, or an error that names the CONNECT, means your proxy did. We produced each proxy failure on purpose and recorded what four clients said:
| What happened | curl 8.7.1 | curl 8.23.0 | Chrome 155 | Python urllib 3.15 | Squid log |
|---|---|---|---|---|---|
| Proxy wants credentials, none or wrong ones sent | (56) CONNECT tunnel failed, response 407 |
(7) CONNECT tunnel failed, response 407 |
net::ERR_INVALID_AUTH_CREDENTIALS |
Tunnel connection failed: 407 Proxy Authentication Required |
TCP_DENIED/407 |
| Proxy policy refuses the CONNECT | (56) CONNECT tunnel failed, response 403 |
(7) CONNECT tunnel failed, response 403 |
net::ERR_TUNNEL_CONNECTION_FAILED |
Tunnel connection failed: 403 Forbidden |
TCP_DENIED/403 |
| Upstream refused the proxy’s connection | (56) CONNECT tunnel failed, response 503 |
(7) CONNECT tunnel failed, response 503 |
net::ERR_TUNNEL_CONNECTION_FAILED |
Tunnel connection failed: 503 Service Unavailable |
TCP_TUNNEL/503, ERR_CONNECT_FAIL 61 |
| TLS interception, CA not trusted | (60) SSL certificate problem: self signed certificate in certificate chain |
(60) SSL certificate OpenSSL verify result: self-signed certificate in certificate chain (19) |
net::ERR_CERT_AUTHORITY_INVALID |
self-signed certificate in certificate chain |
— |
| Proxy not listening | (7) Failed to connect to 127.0.0.1 port 31098 after 0 ms: Couldn't connect to server |
(7) Failed to connect to proxy.wiki:443 over proxy 127.0.0.1 after 0 ms: Could not connect to server |
net::ERR_PROXY_CONNECTION_FAILED |
[Errno 61] Connection refused |
— |
| Site refused the proxy’s exit: a real 1005 | exit 0, HTTP/2 403 with cf-ray |
exit 0, HTTP/2 403 with cf-ray |
403, “Access denied” page | HTTPError 403 with cf-ray |
TCP_TUNNEL/200 |
Two traps sit in that table. The curl exit code for a failed CONNECT changed between builds: 56 (CURLE_RECV_ERROR) on 8.7.1 and 7 (CURLE_COULDNT_CONNECT) on 8.23.0, as libcurl’s error list defines them. A shell script that branches on $? will misfile one of them. And Chrome reports a policy refusal and an unreachable upstream with the same ERR_TUNNEL_CONNECTION_FAILED, error -111 in Chromium’s net error list. Only the proxy’s log tells them apart. One more detail cost us a run: Chrome sends loopback targets direct even with --proxy-server set, so our first “upstream refused” test showed ERR_CONNECTION_REFUSED without touching Squid. --proxy-bypass-list=<-loopback> fixed it.
Proxy authentication (407)
The proxy rejected the credentials or none were sent. The request never left the proxy, so the target site is not involved. Diagnose: look for Proxy-Authenticate in curl -v output. Fix: correct the user and password, and percent-encode any @, : or / inside them. Our 403 vs 407 vs 429 guide covers how the three codes differ.
CONNECT refused by the proxy (403)
The proxy’s policy does not allow a tunnel to that host or port. Squid marks it with X-Squid-Error: ERR_ACCESS_DENIED; commercial gateways use their own headers. Fix: check the provider’s port and destination rules. The site has not blocked you, it has not seen you.
Upstream refusal (503 or 502)
This one has two forms. In the first, the proxy could not connect to the site at all; our Squid answered 503 with ERR_CONNECT_FAIL 61, where 61 is macOS’s errno for connection refused. In the second, the proxy connected fine and the site refused the proxy’s exit address, which is a genuine 1005 travelling inside a healthy tunnel. The CONNECT status separates them: an error code there for the first, 200 for the second. Fix: for the first, test the destination from the proxy’s network or ask the provider; for the second, everything in the causes section above applies.
TLS interception
A certificate error appears before any HTTP exchange, so you never reach the page. Once the inspecting CA is trusted, the error goes away and the site sees the gateway’s address instead, which is cause 3. Fix: install your organisation’s CA bundle where policy requires it (--cacert for curl, SSL_CERT_FILE for Python), and never paper over it with -k in production code.
The curl proxy guide and the Python proxy guide show the client-side flags in more detail.
A script that tells you who answered
This uses only Python’s standard library and sends both headers that matter, so Cloudflare returns JSON rather than the 17-byte fallback. Tested with Python 3.15.0.
#!/usr/bin/env python3
"""Tell a Cloudflare 1005 apart from a proxy failure. Standard library only.
usage: python3 who_blocked_me.py URL [PROXY_URL]
"""
import json, ssl, sys, urllib.error, urllib.request
url = sys.argv[1]
proxy = sys.argv[2] if len(sys.argv) > 2 else None
handlers = [urllib.request.ProxyHandler({"http": proxy, "https": proxy} if proxy else {})]
opener = urllib.request.build_opener(*handlers)
# Both headers matter: without Accept AND Accept-Encoding, Cloudflare sends only "error code: 1005".
req = urllib.request.Request(url, headers={"Accept": "application/json", "Accept-Encoding": "identity"})
try:
with opener.open(req, timeout=20) as r:
print(f"{r.status}: no block, the site answered")
except urllib.error.HTTPError as e:
body = e.read()
if e.headers.get("cf-ray"):
try:
j = json.loads(body)
print(f"{e.code} from Cloudflare: error {j.get('error_code')} {j.get('error_name')}, "
f"retryable={j.get('retryable')}, ray={j.get('ray_id')}")
except ValueError:
print(f"{e.code} from Cloudflare (cf-ray {e.headers['cf-ray']}): {body[:60]!r}")
else:
print(f"{e.code} from something that is not Cloudflare: server={e.headers.get('server')}")
except urllib.error.URLError as e:
reason = e.reason
if isinstance(reason, ssl.SSLCertVerificationError):
print(f"TLS interception or bad certificate: {reason.verify_message}")
else:
print(f"never reached the site: {reason}")
Run against our test bench, with Ray IDs shortened:
$ python3 who_blocked_me.py https://proxy.wiki/cdn-cgi/error/1005
403 from Cloudflare: error 1005 asn_banned, retryable=False, ray=<id>
$ python3 who_blocked_me.py https://proxy.wiki/cdn-cgi/error/1005 http://127.0.0.1:31029
never reached the site: Tunnel connection failed: 407 Proxy Authentication Required
$ python3 who_blocked_me.py https://proxy.wiki/cdn-cgi/error/1005 http://user:pass@127.0.0.1:31029
403 from Cloudflare: error 1005 asn_banned, retryable=False, ray=<id>
$ python3 who_blocked_me.py https://proxy.wiki/cdn-cgi/error/1005 http://127.0.0.1:31030
never reached the site: Tunnel connection failed: 403 Forbidden
$ python3 who_blocked_me.py https://proxy.wiki/cdn-cgi/error/1005 http://127.0.0.1:31031
TLS interception or bad certificate: self-signed certificate in certificate chain
$ python3 who_blocked_me.py https://127.0.0.1:31099/ http://127.0.0.1:31028
never reached the site: Tunnel connection failed: 503 Service Unavailable
$ python3 who_blocked_me.py http://127.0.0.1:31099/ http://127.0.0.1:31028
503 from something that is not Cloudflare: server=squid/6.13
Fixing a 1005 as the site owner
- Get the visitor’s screenshot or Ray ID and the UTC time. Cloudflare’s Ray ID page notes that IDs are not guaranteed unique, so match on time and client IP as well.
- Search Security Events for the Ray ID or client IP. The event shows the rule and the ASN it matched.
- Decide whether the ban is still wanted. Hosting ASNs also carry things you may want: uptime monitors, partner integrations, payment callbacks. Cloudflare’s own IP Access documentation lists APIs, crawlers and payment providers as typical things to allow.
- Pick the narrowest change. Allow one IP for one partner, since Allow beats Block. Switch the ASN rule from Block to Managed Challenge if humans on that network should get through. Or delete the rule. Cloudflare’s caution applies to Allow: an allowed IP or ASN bypasses custom rules, rate limiting and WAF Managed Rules.
- If you keep the ban, customise the 1000-class error page under Custom Errors to say how to request access, and preview it at
/cdn-cgi/error/1005on your own hostname.
To list existing ASN rules, the Access Rules API returns every rule with its target, value, mode and notes. We have not run this against a live zone; the endpoint and field names are from Cloudflare’s API reference, and long lists are paginated.
curl -s "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/firewall/access_rules/rules?per_page=100" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
| jq '.result[] | select(.configuration.target == "asn") | {mode, asn: .configuration.value, notes}'
Other errors numbered 1005
Search results for “error 1005” mix three unrelated things. Two of them matter to developers, and we reproduced both locally.
WebSocket close code 1005. RFC 6455 reserves 1005 for “no status code was present”: the peer sent a Close frame with an empty payload. It must never appear on the wire; your library reports it. A 30-line Python server that completes the handshake and sends the two bytes 0x88 0x00 produced this in Node’s built-in client:
node v24.2.0 WebSocket close: code=1005 reason="" wasClean=true
That is a clean close, not a block. If your proxy or load balancer closes idle WebSockets, 1005 or 1006 is what you will see; 1006 means the connection dropped with no Close frame at all.
NSURLErrorDomain Code=-1005. On Apple platforms this is networkConnectionLost, a connection severed mid-load. A local server that promised 100,000 bytes, sent 10 and closed gave Swift 6.4’s URLSession on macOS 26.6.2:
NSURLErrorDomain Code=-1005 "The network connection was lost."
curl 8.7.1 described the same server as curl: (18) transfer closed with 99990 bytes remaining to read. Neither has anything to do with Cloudflare. Game launchers and other apps also print their own “1005” codes, which are unrelated again.
Cause-to-fix table
| What you see | Who sent it | Diagnostic | Fix |
|---|---|---|---|
| “Error 1005 Access denied”, ASN of a cloud provider | Cloudflare, owner’s IP Access rule | Trace plus Cymru lookup from the machine running the script | Ask the owner to allow your IP; use their API |
| 1005 only with VPN or proxy on | Cloudflare | Trace with and without the VPN or -x |
Exclude the site from the VPN; ask for access |
| 1005 at work, certificate issued by your company’s CA | Cloudflare, judging the gateway | curl -sv ... | grep issuer: |
Ask IT to send the site direct, or the owner to allow the gateway |
| 1005 with your home ISP’s ASN | Cloudflare | Cymru lookup of the number on the page | Only the owner can lift it; send the Ray ID |
Plain error code: 1005 and nothing else |
Cloudflare | Check whether Accept and Accept-Encoding were both sent | Send both to get JSON or the HTML that names the ASN |
CONNECT tunnel failed, response 407 |
Your proxy | Proxy-Authenticate in curl -v |
Correct and percent-encode the credentials |
CONNECT tunnel failed, response 403 |
Your proxy | Server or Via names the proxy; no cf-ray |
Proxy policy; check allowed hosts and ports |
CONNECT tunnel failed, response 503 or 502 |
Your proxy, after the upstream refused it | Proxy error header, for Squid ERR_CONNECT_FAIL |
Test the destination from the proxy’s side |
(60) SSL certificate problem or ERR_CERT_AUTHORITY_INVALID |
An intercepting proxy | Issuer line in curl -v |
Trust the organisation’s CA where policy allows |
WebSocket code=1005 |
The WebSocket peer | Inspect the Close frame | Not a block; handle as a normal close |
NSURLErrorDomain Code=-1005 |
The network path | Repeat the request; check proxies and keep-alive | Retry idempotent requests on a new connection |
How we tested
All captures date from 21 October 2026, on macOS 26.6.2. Clients: curl 8.7.1 (macOS system build, SecureTransport with LibreSSL 3.3.6), curl 8.23.0 (Homebrew, OpenSSL 4.0.3), Python 3.15.0 urllib, Node v24.2.0 fetch and WebSocket, Google Chrome 155.0.8059.85 headless driven over the DevTools protocol, and Swift 6.4 URLSession. The Cloudflare responses are from https://proxy.wiki/cdn-cgi/error/1005, plus 1015, 1020 and 522 on the same path for comparison; no IP Access rule was created or changed. The format rule came from an 18-request matrix and a six-request follow-up. The proxy was Squid 6.13 on 127.0.0.1 with four ports: open, Basic authentication, CONNECT denied, and ssl-bump with a throwaway CA generated by OpenSSL 4.0.3. Port 31099 had nothing listening, to produce the upstream refusal. ASN names come from Team Cymru’s DNS interface. We removed our own IP address, our ASN and the Cloudflare data-centre suffix from the Ray ID headers before publishing.
Frequently asked questions
What does Cloudflare Error 1005 mean?
Can I fix Error 1005 myself?
Why does curl show only “error code: 1005”?
Is a 1005 the same as a proxy 403?
Should a crawler retry a 1005?
How does the owner fix a 1005?
Sources
- Cloudflare Support: Error 1005
- Cloudflare Support: Cloudflare 1xxx errors
- Cloudflare Fundamentals: error responses and content negotiation
- Cloudflare Changelog: Retry-After for retryable 1xxx errors
- Cloudflare WAF: IP Access rules
- Cloudflare WAF: IP Access rule actions
- Cloudflare Ruleset Engine: ip.src.asnum
- Cloudflare Fundamentals: Cloudflare Ray ID
- Cloudflare Fundamentals: HTTP headers
- RFC 6455 section 7.1.5: WebSocket close code 1005
- Apple URL Error: networkConnectionLost