SSL wrong version number proxy: the https:// scheme mistake

SSL wrong version number through a proxy usually means TLS hit a plain HTTP port. See the error in each client, tested, and how to fix the proxy URL.

Terminal session beside the takeaway: Your client spoke TLS to a plain HTTP port. Same https:// proxy URL, different words per client. Tested 2026-11-05 on current curl, Python, Node and Go.
Quick summary · TL;DR
  1. Check for https:// in your proxy URL first. Behind a proxy, wrong version number usually means your client spoke TLS to a port that only speaks HTTP. Changing it to http:// doesn't weaken the encryption to the site.
  2. Your client may not say wrong version number at all. The same mistake, in a test on 2026-11-05, gave ERR_SSL_PACKET_LENGTH_TOO_LONG in Node and tlsv1 alert protocol version in macOS curl. Go said first record does not look like a TLS handshake.
  3. A timeout can be the same bug. tinyproxy and proxy.py stayed silent when they got TLS, so requests just reported Read timed out, which sends you off debugging the network instead of the URL.
  4. A config that used to work isn't proof. For https:// sites, Python's urllib ignored the https:// in the proxy URL on every version tested and urllib3 1.25.11 did too, which is why the same URL can run for years and then break on an upgrade.

If you hit an SSL wrong version number proxy error, look at your proxy URL before anything else. It probably starts with https://, so your client opened with a TLS handshake and the proxy port answered in plain HTTP. Change the scheme to http://, keep the login and port as they are, and your HTTPS sites stay encrypted inside the tunnel.

Here’s the line that usually brings people here, printed by httpx and aiohttp on Python 3.13:

[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1032)

Other clients report the very same mistake in words that never mention a version, and some just hang. Every result below comes from a run on 2026-11-05 on macOS 26.6.2, with test proxies bound to 127.0.0.1, so nothing left the machine.

Why SSL wrong version number appears

A plain proxy port is waiting for text like CONNECT example.com:443 HTTP/1.1. With https:// in the proxy URL, your client’s first bytes are a TLS ClientHello instead, and one captured run started 16 03 01. A port that can’t parse what arrived answers with an HTTP error, also in text.

Your TLS library then reads that answer as a TLS record (RFC 8446, August 2018). The first five bytes of HTTP/1.1 400 are H, T, T, P and /, which decode to:

  • record type 0x48
  • version 0x5454
  • length 20,527 bytes

No TLS version looks like that, so the library gives up there.

The error in each client

Pointed at a plain HTTP proxy that answers 400, the same https:// URL gave this:

ClientWhat it printed
requests 2.34.2, urllib3 2.8.0, Python 3.10 to 3.14ProxyError('Unable to connect to proxy. Your proxy appears to only use HTTP and not HTTPS... around [SSL: WRONG_VERSION_NUMBER]
httpx 0.28.1, Python 3.13ConnectError: [SSL: WRONG_VERSION_NUMBER] wrong version number
aiohttp 3.14.5, Python 3.13ClientConnectorSSLError: Cannot connect to host plus the same SSL text
libcurl 8.23.0 on OpenSSL 3.6.5(35) TLS connect error: error:0A00010B:SSL routines::wrong version number
curl_cffi 0.17.0 on BoringSSLcurl: (35) TLS connect error: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER
macOS curl 8.7.1 (exit 35) and git 2.50.1, LibreSSL 3.3.6LibreSSL/3.3.6: error:1404B42E:SSL routines:ST_CONNECT:tlsv1 alert protocol version
Node 24.14.1, undici 8.12.4ERR_SSL_PACKET_LENGTH_TOO_LONG
Node 24.14.1, built-in fetchTypeError: fetch failed, with that code on error.cause
axios 1.21.0, or got 14.6.6 with https-proxy-agent 9.1.0write EPROTO ... tls_get_more_records:packet length too long
Go 1.27.3proxyconnect tcp: tls: first record does not look like a TLS handshake
Headless Chromium 156net::ERR_PROXY_CONNECTION_FAILED
pip 26.3 with --retries 0Only Could not find a version. Getting the proxy message takes -vv

Node is the easy one to misread. It printed “packet length too long” on the same bytes that gave Python “wrong version number”, and pinning Node to TLS 1.2 or 1.3 didn’t change that, so an EPROTO in an axios stack trace can be this exact bug. Those two messages do fit one reply, since 20,527 is well over the 2^14 + 256 byte limit for an encrypted record. Why Node’s OpenSSL 3.5.5 build picks one check over the other wasn’t traced.

Older builds can word it differently again. Python 3.9.25 on OpenSSL 3.5.4 printed [SSL] record layer failure for a plain port, while 3.10 to 3.14 on newer OpenSSL printed the usual text.

A timeout can be this too

An SSL wrong version number proxy error only shows up when something answers in text, and not every proxy does. Seven ports, one mistake:

What’s on the portIts reply to a ClientHello, 4 s waitWhat you see
proxy-chain 3.0.1HTTP/1.1 400 Bad RequestWrong version number, or the Node and curl text above
tinyproxy 1.11.3Nothingcurl: (28), or Read timed out inside a ProxyError in requests
proxy.py 2.4.10NothingThe same timeouts, and The handshake operation timed out in httpx
mitmproxy 12.3.1A real TLS handshakeCERTIFICATE_VERIFY_FAILED, for mitmproxy’s own certificate
Test port that closesConnection closedUNEXPECTED_EOF_WHILE_READING, or proxyconnect tcp: EOF in Go
SOCKS5, a test port and mitmproxy’s SOCKS5 modeReset or closedcurl: (35) with Connection reset by peer or SSL_ERROR_SYSCALL

Both tinyproxy and proxy.py worked straight away with http://. urllib3’s “only use HTTP” hint appeared only for the text reply, so a missing hint rules nothing out.

Fix the proxy URL scheme

The scheme describes how your client reaches the proxy, and it has nothing to do with the site you’re visiting. You’ll find the same fix in the urllib3 docs (checked 2026-11-05), along with the places worth searching:

  • Your code, meaning the proxies dict, a proxy= argument or --proxy.
  • HTTP_PROXY, HTTPS_PROXY and ALL_PROXY, in both cases, which env | grep -i proxy lists. HTTPS_PROXY=https://... alone broke requests, and HTTP_PROXY=https://... broke a plain http:// site as well, which is easy to miss.
  • The system proxy setting on Windows or macOS. The urllib3 docs suggest checking urllib.request.getproxies(), which python3 -c 'import urllib.request as u; print(u.getproxies())' prints. It was only run here with a variable set, not a real system setting.

Then set it wherever you found it:

export HTTPS_PROXY="http://USERNAME:PASSWORD@HOST:PORT"
curl --proxy "http://USERNAME:PASSWORD@HOST:PORT" https://example.com/
proxy = "http://USERNAME:PASSWORD@HOST:PORT"
r = requests.get("https://example.com/", proxies={"http": proxy, "https": proxy}, timeout=10)
// Node 24: run with NODE_USE_ENV_PROXY=1 HTTPS_PROXY=http://USERNAME:PASSWORD@HOST:PORT
const res = await fetch('https://example.com/');

With the scheme fixed, requests, httpx, aiohttp, curl, pip, undici, built-in fetch, axios 1.21.0 and Go all reached a TLS test site with certificate checks on. On Node, NODE_USE_ENV_PROXY dates from v24.0.0 and the http module’s built-in proxy support from v24.5.0. More client detail is in the guides for Python requests proxies and curl proxies.

Know what http:// leaves exposed on the way to the proxy. A capture from curl and requests showed the CONNECT line and a Proxy-Authorization: Basic header in readable text, which is base64 and not encryption. The site’s own traffic stays inside TLS.

Leaving the scheme off isn’t a safe shortcut. requests and curl fell back to HTTP and worked, curl’s manual (8.23.1) makes that its default, and httpx 0.28.1 raised ValueError: Unknown scheme for proxy URL. Write it out anyway, since the requests docs (checked 2026-11-05) say the scheme is required.

If the port is SOCKS5

Use socks5:// and install the extra your client wants. requests raised InvalidSchema: Missing dependencies for SOCKS support until PySocks was there, and httpx asked for httpx[socks]. Some clients don’t speak SOCKS5 at all, and they won’t say so. Python’s urllib, aiohttp 3.14.5 and axios 1.21.0’s built-in proxy all took a socks5:// URL without complaint, succeeded against an HTTP port and got Connection reset by peer from a real SOCKS5 port.

proxymint’s rotating residential proxies, like its static ISP, mobile and datacenter ones, include both HTTP and SOCKS5, so the URL starts with http:// or socks5:// depending on which you use. SOCKS5 vs HTTP proxies walks through which one suits your client.

Why it worked before

This one wastes hours, because the config looks proven. On https:// sites, Python’s own urllib ignored the https:// and spoke plain HTTP to the proxy on every version tested, 3.9 to 3.14. So it returned 200 from the same URL that made requests fail, and against a port that really speaks TLS it got Connection reset by peer. An http:// site through that URL failed with the usual TLS error, so a script that only fetches HTTPS pages never shows you the mistake.

Older urllib3 did the same for https:// sites. requests 2.29.0 with urllib3 1.25.11 on Python 3.9 returned 200 through that URL, and urllib3 1.26.20 failed with the error. HTTPS proxy support for HTTPS sites arrived in 1.26.0 (2020-11-10), according to the urllib3 changelog, with a warning about this setting in 1.25.9. So an old lockfile can carry a wrong URL for years and break on a dependency bump. A Stack Overflow answer still suggests pinning urllib3==1.25.11, and one tutorial says to upgrade. The pin only hides the wrong URL again, and upgrading won’t clear it, since 2.8.0 fails too.

When the scheme is already http://

Three other setups can land you here.

Your target URL points TLS at a plain port. Requesting an https:// URL on a port that only speaks HTTP gave the same strings through a correct proxy and with no proxy at all. Go put it clearly as http: server gave HTTP response to HTTPS client, and Chromium said ERR_SSL_PROTOCOL_ERROR. So run the request once without the proxy, with curl --noproxy '*' for example. An error that stays means the proxy was never involved, and the port number in your URL is the next thing to read.

You’re on an old axios. Its built-in proxy option changed behaviour in 2026, and this was with a correct plain HTTP proxy:

“Plain GET” means the proxy received GET https://127.0.0.1:18443/ HTTP/1.1 as readable text, and tinyproxy refused that from axios 1.16.0 with a 400. In the axios changelog the fix is listed as a cleartext leak in 1.16.1 (2026-05-13). That version tunnelled but ignored the CA in httpsAgent in this test, which the changelog lists as fixed in 1.17.0 (2026-06-01). protocol: 'https' still fails on 1.21.0 against a plain port, as it should. Upgrading is the fix, and the current docs (checked 2026-11-05) describe the tunnel.

The port is TLS and your URL says http://. That’s the mistake in reverse, and the client sees Connection reset by peer or curl: (56). Anyone running the proxy has a clue in its log. A test proxy using Python’s ssl on OpenSSL 3.6.3 logged [SSL: HTTPS_PROXY_REQUEST] https proxy request.

Probe the port before editing

Two commands tell you what the port speaks, and neither touches your code:

openssl s_client -connect HOST:PORT </dev/null 2>&1 | grep -E 'wrong version|alert protocol|Cipher is'
{ printf 'CONNECT example.com:443 HTTP/1.1\r\nHost: example.com:443\r\n\r\n'; sleep 2; } | nc -w 3 HOST PORT | head -1

On a silent port, tinyproxy and proxy.py included, the first one hangs, so give it a few seconds and press Ctrl-C. Keep the sleep 2 in the second, because mitmproxy sent nothing back when the input closed straight away. The test sent CONNECT to a loopback target, not example.com, so nothing left the machine.

Read them together:

openssl s_clientRaw CONNECTThe port speaksScheme to use
wrong version number, Cipher is (NONE)HTTP/1.x ...Plain HTTPhttp://
No output, it hangsHTTP/1.x ...Plain HTTPhttp://
A real cipher nameHTTP/1.x ...TLS and plain HTTP, like mitmproxyhttp://
A real cipher nameNothingTLShttp:// will not work here
Cipher is (NONE) and no error lineNothingPossibly SOCKS5, or a port that just closesTry socks5://
No outputNothingNothing that answersNeither, so check the host, port and firewall

A real cipher name looks like TLS_AES_256_GCM_SHA384, or ECDHE-RSA-AES256-GCM-SHA384 on a TLS 1.2 port. On macOS the built-in openssl is LibreSSL, which shows alert protocol version instead and its own cipher names, such as AEAD-AES256-GCM-SHA384.

Any HTTP/1.x line shows the port speaks plain HTTP, even a 407 or a 403. It doesn’t prove a proxy is there, because a web server’s plain port answered too, with a 400 from a test port and HTTP/1.0 501 from Python’s http.server. A 407 or 403 is a different problem, and the ERR_TUNNEL_CONNECTION_FAILED guide picks up from there.

SSL wrong version number: what next

For an SSL wrong version number proxy error, stop at the first line that matches:

  1. Start with any https:// in your proxy URL or proxy variables. Change it to http://, or socks5:// for a SOCKS5 port, and do this for timeouts and EOF errors too.
  2. A setup that worked on urllib or an old lockfile was the client skipping TLS, so the fix is still the scheme.
  3. With the proxy removed, the same error points at your target URL, so fix its port or scheme.
  4. On axios below 1.17.0, upgrade before debugging anything else.
  5. A real cipher from openssl s_client and no HTTP/1.x line means the port speaks only TLS, and the certificate questions are a separate job.

Don’t put this in a retry loop. It fails the same way every time until the configuration changes.

Frequently asked questions

It means your client started a TLS handshake and got back something that isn't TLS, usually a plain text HTTP error from the proxy. Read as a record header, those bytes carry a version field that makes no sense, hence the wording. Behind a proxy the usual cause is a proxy URL starting with https:// on a port that only speaks HTTP.

Start the value in your proxies dict with http://, under the http and https keys alike, since the https key only picks which requests use the proxy. The HTTP_PROXY, HTTPS_PROXY and ALL_PROXY variables need the same check. urllib3 2.8.0 also adds a hint to the error, that your proxy appears to only use HTTP and not HTTPS.

Exit code 35 is a failed TLS handshake, which is what an https:// proxy URL on a plain port produces. The text after it depends on the build. libcurl on OpenSSL printed wrong version number, while macOS curl 8.7.1 on LibreSSL printed tlsv1 alert protocol version, and both went away with an http:// proxy URL.

It can be the same https:// proxy mistake. Node 24.14.1 printed ERR_SSL_PACKET_LENGTH_TOO_LONG where Python printed wrong version number against the same bytes. Either message fits that reply, since HTTP/ read as a record header claims 20,527 bytes, well over the TLS limit. Expect EPROTO in axios and got. Built-in fetch hides it under fetch failed, on error.cause.

For the site's traffic, yes. After your client sends CONNECT the proxy opens a tunnel, and TLS runs between your client and the site inside it, so the page content, cookies and requests stay encrypted. The http:// only describes the hop to the proxy. The CONNECT line and any proxy login on that hop aren't encrypted.

No, and it's worth removing if you added it while debugging. The handshake fails before any certificate arrives, so there's nothing to skip. verify=False, curl -k with --proxy-insecure and NODE_TLS_REJECT_UNAUTHORIZED=0 all gave the same error in the test.

Python's urllib skips the TLS step on an https:// site. It ignored the https:// in the proxy URL on every version tested, 3.9 to 3.14, and spoke plain HTTP to the proxy. requests on urllib3 1.26 and later does what the URL says and starts TLS, so only that one fails. The URL still needs fixing, because urllib failed on an http:// site through it, and against a port that really speaks TLS.

Researched and drafted with AI tools, then checked against our publishing rules before it went live: 8 outside links, 5 links to other proxymint pages, no prices and a fact-check pass against our product records. How we write.