diff --git a/.travis.yml b/.travis.yml index bdb9bc0d..c3dc3417 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ install: - python setup.py build develop # newer versions of docutils dropped support for Python 3.4 - if [ $TRAVIS_PYTHON_VERSION == "3.4" ]; then pip install docutils==0.15.2; fi - - pip install PyYAML argparse catkin_pkg rospkg setuptools + - pip install PyYAML argparse certifi catkin_pkg rospkg setuptools - pip install nose coverage mock # command to run tests script: diff --git a/src/rosdistro/loader.py b/src/rosdistro/loader.py index d497b1b1..2f3a995b 100644 --- a/src/rosdistro/loader.py +++ b/src/rosdistro/loader.py @@ -42,10 +42,14 @@ from urllib2 import HTTPError from urllib2 import URLError +# to fix errors with SSL certificate verification +import ssl +import certifi def load_url(url, retry=2, retry_period=1, timeout=10, skip_decode=False): try: - fh = urlopen(url, timeout=timeout) + fh = urlopen(url, timeout=timeout, + context=ssl.create_default_context(cafile=certifi.where())) except HTTPError as e: if e.code in [500, 502, 503] and retry: time.sleep(retry_period)