emissions-api / sentinel5dl

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

Problem with certificates before downloading #87

Open Alexhazl opened 10 months ago

Alexhazl commented 10 months ago

I am trying to execute the following code


from sentinel5dl import search, download, ca_info

# Search for Sentinel-5 products
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')

# Download found products to the local folder
download(result.get('products'))

but I get multiple error type errors:

"Retrying failed HTTP request. (60, 'SSL certificate problem: unable to get local issuer certificate')"

From what I could see inside the documentation you have to modify the path to "cacert" like this

ca_info("C:/../certifi/cacert.pem ")

but clearly I am getting it wrong, what is the correct way to deliver this parameter?

I am using a virtual environment with python 3.6.5.

Thanks in advance

lkiesow commented 10 months ago

I'm not a Windows user and have no way of trying this, but if I remember correctly, we introduced the --use-certifi option in the CLI version of sentinel5dl specifically for Windows users. That means, you can probably just do the same thing.

That is:

https://github.com/emissions-api/sentinel5dl/blob/ab2ff8765bc8fab8b9b7298dcaff37b916ed402e/sentinel5dl/__main__.py#L13

and then

https://github.com/emissions-api/sentinel5dl/blob/ab2ff8765bc8fab8b9b7298dcaff37b916ed402e/sentinel5dl/__main__.py#L169