【问题标题】:SSL Error on using ESRI arcgis python api使用 ESRI arcgis python api 时出现 SSL 错误
【发布时间】:2021-09-21 08:31:26
【问题描述】:

对于我公司的项目,我需要使用 ESRI arcgis python API 来访问我们企业 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 25 Mar 2021- 如果有人能给我一些解决方案,非常感谢

【问题讨论】:

    标签: python ssl proxy arcgis esri


    【解决方案1】:

    在安装 arcgis 后,我们通过使用pip install urllib3==1.25.11 在 python virt env 中将 urllib3 降级到 1.25.11 来克服这个错误

    然后使用 out 代理 gis = GIS(the_url, verify_cert=False, proxy_host="our.proxy", proxy_port=port_num) 连接

    【讨论】:

      猜你喜欢
      • 2018-04-11
      • 1970-01-01
      • 1970-01-01
      • 2021-11-09
      • 2015-04-14
      • 2022-07-27
      • 2021-11-17
      • 2011-03-01
      • 2023-03-13
      相关资源
      最近更新 更多