使用 ESRI arcgis python api 时出现 SSL 错误

问题描述

对于我公司的项目,我需要使用 ESRI arcgis python API 来访问我们 Enterprise ArcGIS 门户中的数据。 安装 arcgis 库后,我通过 GIS() 对连接进行了测试。 代码如下

gis = GIS( profile="link to the portal",username ="username",password="password",verify_cert = False,proxy_host='username:password@proxy_host',proxy_port=proxy_port)

但它给了我如下错误

Please set verify_cert=False due to encountered SSL error: HTTPSConnectionPool(host='www.arcgis.com',port=443): Max retries exceeded with url: /sharing/rest/generatetoken (Caused by SSLError(SSLError(1,'[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')))

即使我设置了verify_cert = False错误仍然存​​在 我也尝试事先在环境中设置代理

os.environ['https_proxy'] = "http://proxy"

也不走运。 我的 openssl 版本是 OpenSSL 1.1.1k 2021 年 3 月 25 日- 如果有人可以为我提供一些解决方案,我将不胜感激

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)