HTTPSConnectionPool(host='api.weixin.qq.com', port=443): Max retries exceeded with url: /cgi-bin/token?appid=wx74a8627810cfa308&grant_ type=client_credential&secret=e40a02f9d79a8097df497e6aaf93ab80 (Caused by ProxyError('Your proxy appears to only use HTTP and not HTTPS, try changing your proxy URL to be HTTP. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#https-proxy-error-http-proxy', SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong versio n number (_ssl.c:1076)'))))
时间: 2024-04-07 19:28:19 浏览: 23
这个错误是由于在使用 HTTPS 连接时,代理服务器只支持 HTTP 连接而不支持 HTTPS 连接引起的。你需要更改你的代理服务器 URL 为 HTTP,以便正确地连接到 API。你可以参考以下链接中的文档了解更多信息:https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#https-proxy-error-http-proxy。
相关问题
eststeps: - name: /cgi-bin/token request: headers: Postman-Token: 9250a585-9ce0-4ffb-a62b-de0d87adde4a User-Agent: PostmanRuntime/7.32.2 method: GET params: appid: wxba9a30b144d1fd16 grant_type: client_credential secret: 6a0b75e631ebe43f6d60a551ad4ac3fe url: https://api.weixin.qq.com/cgi-bin/token validate: - eq: - status_code - 200 - eq: - headers.Content-Type - application/json; encoding=utf-8 yml文件报错: ERROR | HTTPSConnectionPool(host='api.weixin.qq.com', port=443): Max retries exceeded with url: /cgi-bin/token?appid=wxba9a30b144d1fd16&grant_ type=client_credential&secret=6a0b75e631ebe43f6d60a551ad4ac3fe (Caused by ProxyError('Your proxy appears to only use HTTP and not HTTPS, try changing your proxy URL to be HTTP. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#https-proxy-error-http-proxy', SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong versio n number (_ssl.c:1076)'))))怎么修改
根据报错信息来看,您的请求似乎通过代理进行了,但代理只支持HTTP而不支持HTTPS。
您可以尝试以下解决方法:
1. 修改代理设置:将代理的URL改为HTTP协议。您可以按照报错信息中的链接进一步了解如何更改代理URL,或者请联系您的网络管理员获取正确的代理设置。
2. 禁用代理:如果您不需要使用代理,请尝试禁用代理并重试请求。您可以在代码中禁用代理,或在终端中使用以下命令禁用代理:
```
export no_proxy="*"
```
运行此命令后,再次运行您的程序以查看是否解决了问题。
希望这些解决方法能够帮助您解决问题。
python报错:HTTPSConnectionPool(host='qyapi.weixin.qq.com', port=443): Max retries exceeded with url: /cgi-bin/externalcontact/transfer_result?access_token=vWtWuMReq2ZZ8FaLbn8dbLV3UyQhkHpndTxhKwhFbje_7X6b4clm6StFoOXqRUSLdsrl0ZMQcqF_474w4YCZyfO9GUf-1CPF27cCLHy0vP-MPyfwYbQjBEHrWEZfmlFfd3upqIPStFTHHBEB13MYbtoKKHPysQbnMgVSFVL2V8YwQp4HEzmlgk7WPHyJtYARwmyE8QFmGJs0F835YJy7Qw (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001FC5EFC1790>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
这个错误表明你的代码无法建立与 `qyapi.weixin.qq.com` 的 HTTPS 连接。常见的原因可能是网络连接问题或无法解析主机名。
请检查以下几点:
1. 确保你的网络连接正常。尝试访问其他网站来验证网络连接是否正常。
2. 确保你的代码可以访问 `qyapi.weixin.qq.com`。你可以尝试使用浏览器或其他工具访问该 URL,看是否能够成功连接。
3. 确保你的代码运行环境可以解析主机名。有时候,DNS 配置问题可能导致无法解析主机名。你可以尝试在代码中使用 IP 地址代替主机名,看是否能够解决问题。
如果上述步骤都没有解决问题,那可能是由于其他原因导致的连接问题。在这种情况下,你可能需要进一步调查或联系相关技术支持人员来获取帮助。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)