小编kor*_*epp的帖子

带有代理的 Python 请求导致 SSLError WRONG_VERSION_NUMBER

我不能在 Python 中使用不同的代理。

我的代码:

import requests

proxies = {
    "https":'https://154.16.202.22:3128',
    "http":'http://154.16.202.22:3128'
    }

r=requests.get('https://httpbin.org/ip', proxies=proxies)
print(r.json()) 
Run Code Online (Sandbox Code Playgroud)

我得到的错误是:

.
.
.
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='httpbin.org', port=443): Max retries exceeded with url: /ip (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1122)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 
  .
  .
  .
requests.exceptions.SSLError: HTTPSConnectionPool(host='httpbin.org', port=443): Max retries exceeded with url: /ip (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1122)')))
Run Code Online (Sandbox Code Playgroud)

我执行了pip …

python ssl proxy python-requests

7
推荐指数
2
解决办法
7540
查看次数

标签 统计

proxy ×1

python ×1

python-requests ×1

ssl ×1