[GH-ISSUE #3300] [Windows][Premium] Tunnel DNS rewrites chatgpt.com / api.openai.com to a proxy that drops ~70% of TLS handshakes (Codex fails with os error 10053) #3168

Open
opened 2026-10-25 04:14:49 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @papadone on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3300

Describe the bug
On Amnezia Premium, the DNS inside the tunnel resolves OpenAI domains not to their real Cloudflare addresses but to a proxy IP. That proxy fails most TLS handshakes, so OpenAI Codex constantly drops with:
stream disconnected before completion: IO error: An established connection was aborted by the software in your host machine. (os error 10053)

Browsing other sites (google.com etc.) through the same tunnel works fine.

Environment

  • AmneziaVPN 5.0.3.0, Windows 11 (10.0.26200)
  • Amnezia Premium, exit Finland (exit IP in AS9009 M247, Helsinki); same result on 3 other countries
  • Protocols tested: AmneziaWG and VLESS — same result
  • "Use AmneziaDNS" is OFF, custom DNS set to 1.1.1.1 / 1.0.0.1 — ignored, the tunnel interface still gets 100.64.0.1, 8.8.4.4 (see also #2655)

What happens

  1. Inside the tunnel chatgpt.com, api.openai.com, auth.openai.com resolve to 57.129.144.160 (AS16276 OVH, GB), after reconnect — 216.152.150.132.
  2. The same rewritten answer comes back even when querying 1.1.1.1, 8.8.8.8 or 9.9.9.9 directly — plain DNS on port 53 is intercepted in the tunnel.
  3. Real addresses via DoH (cloudflare-dns.com): chatgpt.com → 104.18.32.47, 172.64.155.209, api.openai.com → 172.66.0.243, 162.159.140.245.

Measurements (curl, same tunnel, same moment)

Target Success
https://chatgpt.com/backend-api/codex/responses via proxy IP (AmneziaWG) 2 / 10
same via proxy IP (VLESS) 5 / 15
https://api.openai.com/v1/models via proxy IP 1–2 / 4–5
same endpoints via real IP (curl --resolve chatgpt.com:443:104.18.32.47) 15 / 15, 5 / 5

Failures are curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed after ~0.4–1.5 s.
Via the real IP OpenAI answers normally (401 Unauthorized without a token — no region block), so the proxy is not needed for this exit.

Workaround
Pinning real IPs in the hosts file (traffic still goes through the tunnel, just bypassing the proxy) fixes Codex completely.

Expected behavior

  • Either don't rewrite OpenAI domains for exits where OpenAI is reachable directly, or fix the proxy.
  • Respect the "Use AmneziaDNS" switch / custom DNS on Premium, or clearly show in the UI that it is ignored.

Possibly related: #2655, #2375, #2996

Originally created by @papadone on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3300 **Describe the bug** On Amnezia Premium, the DNS inside the tunnel resolves OpenAI domains not to their real Cloudflare addresses but to a proxy IP. That proxy fails most TLS handshakes, so OpenAI Codex constantly drops with: `stream disconnected before completion: IO error: An established connection was aborted by the software in your host machine. (os error 10053)` Browsing other sites (google.com etc.) through the same tunnel works fine. **Environment** - AmneziaVPN 5.0.3.0, Windows 11 (10.0.26200) - Amnezia Premium, exit Finland (exit IP in AS9009 M247, Helsinki); same result on 3 other countries - Protocols tested: AmneziaWG and VLESS — same result - "Use AmneziaDNS" is OFF, custom DNS set to 1.1.1.1 / 1.0.0.1 — ignored, the tunnel interface still gets `100.64.0.1, 8.8.4.4` (see also #2655) **What happens** 1. Inside the tunnel `chatgpt.com`, `api.openai.com`, `auth.openai.com` resolve to `57.129.144.160` (AS16276 OVH, GB), after reconnect — `216.152.150.132`. 2. The same rewritten answer comes back even when querying `1.1.1.1`, `8.8.8.8` or `9.9.9.9` directly — plain DNS on port 53 is intercepted in the tunnel. 3. Real addresses via DoH (cloudflare-dns.com): `chatgpt.com` → `104.18.32.47, 172.64.155.209`, `api.openai.com` → `172.66.0.243, 162.159.140.245`. **Measurements (curl, same tunnel, same moment)** | Target | Success | |---|---| | `https://chatgpt.com/backend-api/codex/responses` via proxy IP (AmneziaWG) | 2 / 10 | | same via proxy IP (VLESS) | 5 / 15 | | `https://api.openai.com/v1/models` via proxy IP | 1–2 / 4–5 | | same endpoints via real IP (`curl --resolve chatgpt.com:443:104.18.32.47`) | 15 / 15, 5 / 5 | Failures are `curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed` after ~0.4–1.5 s. Via the real IP OpenAI answers normally (`401 Unauthorized` without a token — no region block), so the proxy is not needed for this exit. **Workaround** Pinning real IPs in the `hosts` file (traffic still goes through the tunnel, just bypassing the proxy) fixes Codex completely. **Expected behavior** - Either don't rewrite OpenAI domains for exits where OpenAI is reachable directly, or fix the proxy. - Respect the "Use AmneziaDNS" switch / custom DNS on Premium, or clearly show in the UI that it is ignored. Possibly related: #2655, #2375, #2996
Author
Owner

@eshinsimon commented on GitHub (Oct 20, 2026):

same

<!-- gh-comment-id:6294748036 --> @eshinsimon commented on GitHub (Oct 20, 2026): same
Author
Owner

@eshinsimon commented on GitHub (Oct 20, 2026):

We found a workaround on Windows 11 with Amnezia Premium 5.0.3.0.
Disabling AmneziaDNS did not remove the DNS rewriting: OpenAI domains still resolved to 57.129.144.160.
We configured Windows to use Cloudflare DNS-over-HTTPS specifically for chatgpt.com, openai.com, and their subdomains:

  • Resolvers: 1.1.1.1 and 1.0.0.1
  • DoH AutoUpgrade = true
  • AllowFallbackToUdp = false
  • Windows NRPT rules directing these domains to those resolvers

After clearing the DNS cache and reconnecting the VPN, OpenAI domains resolved to their public Cloudflare addresses. ChatGPT’s /cdn-cgi/trace showed NL, matching the selected VPN country, instead of GB.

Over approximately 70 minutes, Codex logged 142 model requests with no TLS handshake failures. Two separate WebSocket resets occurred, but both recovered automatically.
This bypasses the problematic DNS redirection while keeping the connection through the VPN.

PowerShell commands we used, run as Administrator:

Set-DnsClientDohServerAddress `
  -ServerAddress '1.1.1.1','1.0.0.1' `
  -AutoUpgrade $true `
  -AllowFallbackToUdp $false

Add-DnsClientNrptRule `
  -Namespace 'chatgpt.com','.chatgpt.com','openai.com','.openai.com' `
  -NameServers '1.1.1.1','1.0.0.1' `
  -Comment 'OpenAI via encrypted DNS'

Clear-DnsClientCache
<!-- gh-comment-id:6297535484 --> @eshinsimon commented on GitHub (Oct 20, 2026): We found a workaround on Windows 11 with Amnezia Premium 5.0.3.0. Disabling AmneziaDNS did not remove the DNS rewriting: OpenAI domains still resolved to **57.129.144.160.** We configured Windows to use Cloudflare DNS-over-HTTPS specifically for chatgpt.com, openai.com, and their subdomains: - Resolvers: 1.1.1.1 and 1.0.0.1 - DoH AutoUpgrade = true - AllowFallbackToUdp = false - Windows NRPT rules directing these domains to those resolvers After clearing the DNS cache and reconnecting the VPN, OpenAI domains resolved to their public Cloudflare addresses. ChatGPT’s [/cdn-cgi/trace](https://chatgpt.com/cdn-cgi/trace) showed **NL**, matching the selected VPN country, instead of **GB**. Over approximately 70 minutes, Codex logged 142 model requests with no TLS handshake failures. Two separate WebSocket resets occurred, but both recovered automatically. This bypasses the problematic DNS redirection while keeping the connection through the VPN. PowerShell commands we used, run as Administrator: ``` Set-DnsClientDohServerAddress ` -ServerAddress '1.1.1.1','1.0.0.1' ` -AutoUpgrade $true ` -AllowFallbackToUdp $false Add-DnsClientNrptRule ` -Namespace 'chatgpt.com','.chatgpt.com','openai.com','.openai.com' ` -NameServers '1.1.1.1','1.0.0.1' ` -Comment 'OpenAI via encrypted DNS' Clear-DnsClientCache ```
Author
Owner

@papadone commented on GitHub (Oct 21, 2026):

Thanks, this is a cleaner workaround than what I used (pinning real IPs in hosts).

Two notes from my side:

  1. Add oaistatic.com and oaiusercontent.com to the NRPT rule. With only chatgpt.com/openai.com bypassed, ChatGPT in the browser still loads static/files through the Amnezia proxy. Mixing two egress IPs in one session gave me a cloudflare_challenge error in ChatGPT/Codex. Covering all four domains (plus their subdomains) avoided that:
    -Namespace 'chatgpt.com','.chatgpt.com','openai.com','.openai.com','oaistatic.com','.oaistatic.com','oaiusercontent.com','.oaiusercontent.com'

  2. Update: after Amnezia support told me to reload the configuration, I got a new exit server, and the proxy (57.129.144.160) started working: 15/15 TLS handshakes OK vs 2–5/15 before. I removed my workaround and everything goes through the proxy again. So the root issue seems to be on specific proxy/server instances, and it would still be good for Amnezia to either fix them or stop rewriting OpenAI DNS where the exit reaches OpenAI directly.

<!-- gh-comment-id:6307270808 --> @papadone commented on GitHub (Oct 21, 2026): Thanks, this is a cleaner workaround than what I used (pinning real IPs in `hosts`). Two notes from my side: 1. **Add `oaistatic.com` and `oaiusercontent.com` to the NRPT rule.** With only `chatgpt.com`/`openai.com` bypassed, ChatGPT in the browser still loads static/files through the Amnezia proxy. Mixing two egress IPs in one session gave me a `cloudflare_challenge` error in ChatGPT/Codex. Covering all four domains (plus their subdomains) avoided that: `-Namespace 'chatgpt.com','.chatgpt.com','openai.com','.openai.com','oaistatic.com','.oaistatic.com','oaiusercontent.com','.oaiusercontent.com'` 2. **Update:** after Amnezia support told me to reload the configuration, I got a new exit server, and the proxy (`57.129.144.160`) started working: 15/15 TLS handshakes OK vs 2–5/15 before. I removed my workaround and everything goes through the proxy again. So the root issue seems to be on specific proxy/server instances, and it would still be good for Amnezia to either fix them or stop rewriting OpenAI DNS where the exit reaches OpenAI directly.
Author
Owner

@avekoruts commented on GitHub (Nov 5, 2026):

<html><head></head>

Additional reproduction on Ubuntu/Linux — November 5, 2026

I can confirm a similar issue with Amnezia Premium on Ubuntu/Linux, reproduced on November 5, 2026.

I compared Amnezia Premium with my self-hosted AmneziaWG connection on the same machine. ChatGPT works through the self-hosted connection but fails to work properly through Premium.

Test 1: Self-hosted AmneziaWG (working)

  • Public exit IP: [redacted — personal self-hosted VPS]

  • chatgpt.com resolves to 104.18.32.47, 172.64.155.209 (Cloudflare).

  • auth.openai.com resolves to 104.18.41.241, 172.64.146.15 (Cloudflare).

  • HTTPS results:

    • chatgpt.com: HTTP 200, TLS successful.

    • auth.openai.com: HTTP 403, TLS successful.

    • api.openai.com: HTTP 421, TLS successful.

Test 2: Amnezia Premium (not working properly)

  • Public exit IP: [redacted — Amnezia Premium exit server]

  • chatgpt.com resolves to 51.77.103.60.

  • auth.openai.com resolves to the same IP: 51.77.103.60.

  • HTTPS results:

    • chatgpt.com: HTTP 200, TLS successful.

    • auth.openai.com: TLS handshake fails.

    • api.openai.com: TLS handshake fails.

Both failed connections produce:

curl: (35) TLS connect error:
error:0A000126:SSL routines::unexpected eof while reading
HTTP: 000

Test 3: Amnezia Premium with public Cloudflare IPs forced via curl --resolve

Without disconnecting Premium, I repeated the HTTPS requests while explicitly resolving the domains to their public Cloudflare IPs:

Domain Forced IP Result
chatgpt.com 104.18.32.47 HTTP 200, TLS successful
auth.openai.com 104.18.41.241 HTTP 403, TLS successful
api.openai.com 172.66.0.243 HTTP 421, TLS successful

Example command:

curl -4 -sS -o /dev/null --max-time 15 \
  --resolve "auth.openai.com:443:104.18.41.241" \
  -w 'HTTP: %{http_code} | Remote IP: %{remote_ip} | TLS: %{time_appconnect}s\n' \
  https://auth.openai.com

All three TLS handshakes succeeded, with TLS connection times of approximately 0.16 seconds each.

Conclusion

These results strongly suggest that the problem is associated with the DNS-rewritten destination (51.77.103.60) or its proxy infrastructure, rather than the AmneziaWG tunnel itself.

The HTTP 403 and 421 responses are included as evidence that HTTPS/TLS connectivity works, not as confirmation that the applications themselves are fully functional.

No persistent DNS changes or other workarounds were applied. I am currently using my self-hosted AmneziaWG connection as an alternative.

This may indicate another affected Premium proxy/server instance, similar to the original report. Hopefully these results help identify and fix the underlying issue.

</html>
<!-- gh-comment-id:6653622040 --> @avekoruts commented on GitHub (Nov 5, 2026): <html><head></head><body><h3><span>Additional reproduction on Ubuntu/Linux — November 5, 2026</span></h3><p><span>I can confirm a similar issue with </span><strong><span>Amnezia Premium on Ubuntu/Linux</span></strong><span>, reproduced on November 5, 2026.</span></p><p><span>I compared Amnezia Premium with my self-hosted AmneziaWG connection on the same machine. ChatGPT works through the self-hosted connection but fails to work properly through Premium.</span></p><p><strong><span>Test 1: Self-hosted AmneziaWG (working)</span></strong></p><ul><li><p><span>Public exit IP: </span><code><span>[redacted — personal self-hosted VPS]</span></code></p></li><li><p><code><span>chatgpt.com</span></code><span> resolves to </span><code><span>104.18.32.47</span></code><span>, </span><code><span>172.64.155.209</span></code><span> (Cloudflare).</span></p></li><li><p><code><span>auth.openai.com</span></code><span> resolves to </span><code><span>104.18.41.241</span></code><span>, </span><code><span>172.64.146.15</span></code><span> (Cloudflare).</span></p></li><li><p><span>HTTPS results:</span></p><ul><li><p><code><span>chatgpt.com</span></code><span>: HTTP 200, TLS successful.</span></p></li><li><p><code><span>auth.openai.com</span></code><span>: HTTP 403, TLS successful.</span></p></li><li><p><code><span>api.openai.com</span></code><span>: HTTP 421, TLS successful.</span></p></li></ul></li></ul><p><strong><span>Test 2: Amnezia Premium (not working properly)</span></strong></p><ul><li><p><span>Public exit IP: </span><code><span>[redacted — Amnezia Premium exit server]</span></code></p></li><li><p><code><span>chatgpt.com</span></code><span> resolves to </span><code><span>51.77.103.60</span></code><span>.</span></p></li><li><p><code><span>auth.openai.com</span></code><span> resolves to the same IP: </span><code><span>51.77.103.60</span></code><span>.</span></p></li><li><p><span>HTTPS results:</span></p><ul><li><p><code><span>chatgpt.com</span></code><span>: HTTP 200, TLS successful.</span></p></li><li><p><code><span>auth.openai.com</span></code><span>: TLS handshake fails.</span></p></li><li><p><code><span>api.openai.com</span></code><span>: TLS handshake fails.</span></p></li></ul></li></ul><p><span>Both failed connections produce:</span></p><pre><code><span>curl: (35) TLS connect error: error:0A000126:SSL routines::unexpected eof while reading HTTP: 000</span></code></pre><p><strong><span>Test 3: Amnezia Premium with public Cloudflare IPs forced via curl --resolve</span></strong></p><p><span>Without disconnecting Premium, I repeated the HTTPS requests while explicitly resolving the domains to their public Cloudflare IPs:</span></p> <table> <thead> <tr> <th>Domain</th> <th>Forced IP</th> <th>Result</th> </tr> </thead> <tbody> <tr> <td>chatgpt.com</td> <td>104.18.32.47</td> <td>HTTP 200, TLS successful</td> </tr> <tr> <td>auth.openai.com</td> <td>104.18.41.241</td> <td>HTTP 403, TLS successful</td> </tr> <tr> <td>api.openai.com</td> <td>172.66.0.243</td> <td>HTTP 421, TLS successful</td> </tr> </tbody> </table> <p><span>Example command:</span></p><pre><code><span>curl -4 -sS -o /dev/null --max-time 15 \ --resolve "auth.openai.com:443:104.18.41.241" \ -w 'HTTP: %{http_code} | Remote IP: %{remote_ip} | TLS: %{time_appconnect}s\n' \ https://auth.openai.com</span></code></pre><p><span>All three TLS handshakes succeeded, with TLS connection times of approximately 0.16 seconds each.</span></p><p><strong><span>Conclusion</span></strong></p><p><span>These results strongly suggest that the problem is associated with the DNS-rewritten destination (</span><code><span>51.77.103.60</span></code><span>) or its proxy infrastructure, rather than the AmneziaWG tunnel itself.</span></p><p><span>The HTTP 403 and 421 responses are included as evidence that HTTPS/TLS connectivity works, not as confirmation that the applications themselves are fully functional.</span></p><p><span>No persistent DNS changes or other workarounds were applied. I am currently using my self-hosted AmneziaWG connection as an alternative.</span></p><p><span>This may indicate another affected Premium proxy/server instance, similar to the original report. Hopefully these results help identify and fix the underlying issue.</span></p></body></html>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#3168
No description provided.