连接到外部网站时出现 SSL 错误

时间:2021-03-11 05:32:39

标签: python ssl

我正在尝试使用以下代码在 python 中使用库“landsatxplore”下载 Landsat 场景:

from landsatxplore.earthexplorer import EarthExplorer

ee = EarthExplorer(username, password)

ee.download(scene_id='LT51960471995178MPS00', output_dir=r'C:\Users\user1\Desktop\landsat')

ee.logout()

运行上述代码后,出现以下错误:

SSLError: HTTPSConnectionPool(host='ers.cr.usgs.gov', port=443): Max retries exceeded with url: /login/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1051)')))

我在使用 Sentinel Python API 下载哨兵场景时也面临同样的问题。

我在一个配置了代理的系统上工作。在我系统的环境变量中,我添加了 HTTP_PROXY 和 HTTPS_PROXY。甚至我位于“C:\Users\user1”的“.condarc”文件看起来像:

channels:
  - defaults

show_channel_urls: True
allow_other_channels: True

proxy_servers:
  http: username:password@xx.xx.xx.xx:8080
  https: username:password@xx.xx.xx.xx:8080

ssl_verify: True

请告诉我可能是什么问题以及如何解决这个问题。

0 个答案:

没有答案
相关问题