[BUG] ECONNRESET on WSL2 Ubuntu 22.04 - TLS 1.3 decode error with embedded runtime
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code v2.1.76 fails with ECONNRESET on every prompt in WSL2.
Environment:
- WSL2 Ubuntu 22.04.3 LTS, kernel 5.15.146.1-microsoft-standard-WSL2
- Node.js 22.22.1 (nvm)
- Windows 11 Home 10.0.26200
Diagnosis:
- curl and openssl connect to api.anthropic.com fine (TLS 1.3 works)
- Node.js https module works with TLS 1.2: Status 404 (correct)
- Node.js https module fails with TLS 1.3: EPROTO ssl3_read_bytes:tlsv1 alert decode error (alert 50)
- Node.js fetch() (undici) fails with TLS 1.3, works with NODE_OPTIONS="--tls-max-v1.2"
- Claude Code binary ignores NODE_OPTIONS (embedded runtime)
- ECONNRESET persists regardless of NODE_OPTIONS, proxy vars, etc.
Already tried:
- WSL network mirroring mode
- Disabling Windows Firewall
- Disabling Windows Security real-time protection
- Lowering MTU
- NODE_OPTIONS="--tls-max-v1.2"
- Various proxy/TLS env vars (HTTPS_PROXY, SSL_CERT_FILE, NODE_EXTRA_CA_CERTS)
- NODE_TLS_REJECT_UNAUTHORIZED=0
Root cause: Claude Code's embedded runtime negotiates TLS 1.3, which triggers
"decode error (alert 50)" specifically in WSL2's network stack. Forcing TLS 1.2
fixes it for standalone Node.js but Claude Code's binary doesn't respect NODE_OPTIONS.
Requested fix: Add env var (e.g. CLAUDE_TLS_MAX_VERSION) to control TLS version,
or default to TLS 1.2 fallback on connection failure.
What Should Happen?
I expect to have an active connection just as I have in my powershell erminal in windows
Error Messages/Logs
claude "helllo"
╭─── Claude Code v2.1.76 ────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │ Tips for getting started │
│ Welcome back ****! │ Run /init to create a CLAUDE.md file with instructions for Claude │
│ │ ───────────────────────────────────────────────────────────────── │
│ ▐▛███▜▌ │ Recent activity │
│ ▝▜█████▛▘ │ No recent activity │
│ ▘▘ ▝▝ │ │
│ Sonnet 4.6 · Claude Pro · **** │ │
│ Organization │ │
│ ~/**** │ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
❯ helllo
⎿ Unable to connect to API (ECONNRESET)
Steps to Reproduce
Access WSL2 in windows11 and prompt something under claude cosw: All models
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.76 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
With default setup of WSL2 I do not even receive a server Hello form Anthropic, however as mentioned, after trying several things I do receive it but still see the ECONNRESET
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗