diff --git a/grip/github_renderer.py b/grip/github_renderer.py index 99dabe2..4653aa3 100644 --- a/grip/github_renderer.py +++ b/grip/github_renderer.py @@ -18,7 +18,7 @@ def render_content(text, gfm=False, context=None, headers = {'content-type': 'text/x-markdown'} auth = (username, password) if username or password else None - r = requests.post(url, headers=headers, data=data, auth=auth) + r = requests.post(url, headers=headers, data=data, auth=auth, verify=False) # Relay HTTP errors if r.status_code != 200: diff --git a/grip/server.py b/grip/server.py index 0c41199..818c621 100644 --- a/grip/server.py +++ b/grip/server.py @@ -259,7 +259,7 @@ def _get_style_urls(source_url, style_pattern, asset_pattern, return cached # Find style URLs - r = requests.get(source_url) + r = requests.get(source_url, verify=False) if not 200 <= r.status_code < 300: print(' * Warning: retrieving styles gave status code', r.status_code) @@ -303,7 +303,7 @@ def _to_data_url(app, url, content_type): def _download(app, url): if urlparse(url).netloc: - return requests.get(url).content + return requests.get(url, verify=False).content with app.test_client() as c: return c.get(url).data @@ -374,7 +374,7 @@ def _cache_contents(style_urls, asset_pattern, asset_pattern_sub, cache_path): asset_urls = [] for style_url in style_urls: filename = _cache_filename(style_url, cache_path) - contents = requests.get(style_url).text + contents = requests.get(style_url, verify=False).text # Find assets and replace their base URLs with the cache directory asset_urls += map(lambda url: urljoin(style_url, url), re.findall(asset_pattern, contents)) @@ -385,7 +385,7 @@ def _cache_contents(style_urls, asset_pattern, asset_pattern_sub, cache_path): for asset_url in asset_urls: filename = _cache_filename(asset_url, cache_path) - contents = requests.get(asset_url).text + contents = requests.get(asset_url, verify=False).text # Write file and show message _write_file(filename, contents) print(' * Cached', asset_url, 'in', cache_path)