26

Python version: 3.9.1

I trying to write bot that send requests and it work perfectly fine, the only issue that i have is when i trying to use web debugging programs such as Charles 4.6.1 or Fiddler Everywhere. When I open it to see bot traffic and response form server it crash showing me this error:

(Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1124)')))

I used to have this issue and I was able to fix it by simply adding verify=False to my request, but right now it does not work.

Marco Bonelli
  • 63,369
  • 21
  • 118
  • 128
NoNam4
  • 457
  • 1
  • 4
  • 12

4 Answers4

33

I had the same problem. It's a bug in urllib3. You have to specify your proxy in the request, and change the 'https' value to 'http'.

My example:

proxies = {'https': 'http://127.0.0.1:8888'}
request = r.get('https://www.example.net', verify=False, proxies=proxies)
Bryan Hamilton
  • 355
  • 3
  • 3
17

Try this answer.

In short you should downgrade urllib:

pip3 install urllib3==1.23
marcin
  • 517
  • 4
  • 23
5

If anyone else is having this issue in 2023, simply updating the urllib3 library worked for me.

python -m pip install --upgrade urllib3
bfontaine
  • 18,169
  • 13
  • 73
  • 107
jv_mob
  • 66
  • 1
  • 3
1

I had the same problem but i solved it by changing the "https" in the URL to "http":

Example:

ulr_example = 'https://example.com'

to

url_example = 'http://example.com'