encode / httpx

A next generation HTTP client for Python. 🦋
https://www.python-httpx.org/
BSD 3-Clause "New" or "Revised" License
13.29k stars 845 forks source link

[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108),when i using proxies,it show this error. #951

Closed ch-boogeyman closed 4 years ago

ch-boogeyman commented 4 years ago

error My proxy has no problem,i test it in requests module,but when i using httpx with proxies,it show this, please how to resolve it?

tomchristie commented 4 years ago

Presumably we use a more secure set ofSSL options than requests currently default to.

We ought to do some work on documenting failures here, and showing users how to tweak the finer-grained details of the SSL config if needed.

yeraydiazdiaz commented 4 years ago

Hi, I've seen this error when trying to connect to a host using https on a port that does not support it.

In your case I think the problem is that in your proxies dict you have a proxy URL like https://<PROXY_IP>:80, meaning it will try to use HTTPS on port 80, which most likely will not support TLS since it's usually port number 443.

I think you could solve it by removing the https from that proxy URL.

ch-boogeyman commented 4 years ago

proxy

work pro rovmove https like the picture?But the proxies won't work!! The website which i crawled has wrong SSL certificate,So i add verify=False ,but it still show the error,i don't know how to resolve it? https://jxfw.gdut.edu.cn/, a chinese web

yeraydiazdiaz commented 4 years ago

What I meant was for you to set proxies as:

proxies = {
   'http': 'http://.....',
   'https': 'http://.....',  # The same URL as above
}
ch-boogeyman commented 4 years ago

我的意思是让你proxies作为:

proxies = {
   'http': 'http://.....',
   'https': 'http://.....',  # The same URL as above
}

new err Thank you for your help so much, but it showed another ProxyError error…

yeraydiazdiaz commented 4 years ago

That means the proxy is rejecting your request for some reason.

I'm sorry but since that's not an error in HTTPX anymore so I can't help you any further. Good luck!

ch-boogeyman commented 4 years ago

That means the proxy is rejecting your request for some reason.

I'm sorry but since that's not an error in HTTPX anymore so I can't help you any further. Good luck!

That is my proxy's problem,i changed https to http and change my proxy,it turned to OK, thank‘s for Contributor‘s help,httpx is excellent!!