Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSL: WRONG_VERSION_NUMBER ON PYTHON REQUEST

Python version: 3.9.1

Hello big brains!!

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 by i was available to fix it by simply adding "verify=False" to my request post but right now it does not work and i try a lot of things to fix it but nothing help and i have no idea whats wrong.

like image 626
NoNam4 Avatar asked Dec 31 '20 03:12

NoNam4


2 Answers

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)
like image 125
Bryan Hamilton Avatar answered Sep 16 '22 19:09

Bryan Hamilton


Try this answer.

In short you should downgrade urllib:

pip3 install urllib3==1.23
like image 44
marcin Avatar answered Sep 17 '22 19:09

marcin