Skip to content

Commit

Permalink
certifi
Browse files Browse the repository at this point in the history
  • Loading branch information
lkiesow committed Oct 31, 2019
1 parent 9681836 commit 63f4465
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sentinel5dl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

logger = logging.getLogger(__name__)

ca_info = None


def __md5(filename):
'''Generate the md5 sum of a file
Expand Down Expand Up @@ -79,6 +81,10 @@ def __http_request(path, filename=None):
curl.setopt(curl.USERPWD, f'{USER}:{PASS}')
curl.setopt(curl.WRITEDATA, f)
curl.setopt(curl.FAILONERROR, True)

if ca_info:
curl.setopt(pycurl.CAINFO, ca_info)

curl.perform()
curl.close()
if not filename:
Expand Down
3 changes: 3 additions & 0 deletions sentinel5dl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:license: MIT
'''

import certifi
import logging

import sentinel5dl
Expand All @@ -20,6 +21,8 @@ def main():
logger = logging.getLogger(sentinel5dl.__name__)
logger.setLevel(logging.INFO)

sentinel5dl.ca_info = certifi.where()

# Search for Sentinel-5 products
result = search(
polygon='POLYGON((7.88574278354645 49.347193400927495,'
Expand Down

0 comments on commit 63f4465

Please sign in to comment.