emissions-api / sentinel5dl

Sentinel-5(P) Downloader
https://sentinel5dl.emissions-api.org
MIT License
12 stars 9 forks source link

SSL certificate problem: #74

Closed kirtan29 closed 3 years ago

kirtan29 commented 3 years ago

The example code is giving this error.

>>> from sentinel5dl import search, download
>>> result = search(
...         polygon='POLYGON((7.8 49.3,13.4 49.3,13.4 52.8,7.8 52.8,7.8 49.3))',
...         begin_ts='2019-09-01T00:00:00.000Z',
...         end_ts='2019-09-17T23:59:59.999Z',
...         product='L2__CO____',
...         processing_level='L2',
...         processing_mode='Offline')
Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')
Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')
Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')
Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')
Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')
Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')
Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')
Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')
Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')
Traceback (most recent call last):
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 195, in search
    processing_mode, count, per_request_limit)
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 162, in _search
    body = __http_request(path)
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 125, in __http_request
    __http_request(path, filename, retries-1)
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 125, in __http_request
    __http_request(path, filename, retries-1)
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 125, in __http_request
    __http_request(path, filename, retries-1)
  [Previous line repeated 6 more times]
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 122, in __http_request
    raise err
  File "C:\Users\hp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sentinel5dl\__init__.py", line 109, in __http_request
    curl.perform()
pycurl.error: (60, 'SSL certificate problem: unable to get local issuer certificate')

EDIT @lkiesow: Updated formatting

lkiesow commented 3 years ago

You seem to run sentinal5dl on Windows. That causes Python to have issues with verifying certificated. For that, the --use-certifi switch exists which uses the certificates provided by certifi for verification instead.