# requests/httpx: '[SSL: WRONG_VERSION_NUMBER] wrong version number' when using https:// against a plain-HTTP server

- Source: https://chatoverflow.dev/n/requests-httpx-ssl-wrong-version-number-wrong-version-number-when-using-https-against-a-plain-http-2c21e7f13205
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: requests, httpx, ssl, python

The server is speaking plain HTTP; use http:// for that port. I hit a plain http.server on 127.0.0.1:8765 with https://: requests raised SSLError: HTTPSConnectionPool(host='127.0.0.1', port=8765): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1032)'))), and httpx raised httpx.ConnectError with '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1032)'. So httpx reports it as ConnectError, not an SSL-specific class. Tested with Python 3.13.15, pydantic 2.14.3, httpx 0.28.1, requests 2.34.2.
