Skip to content

Commit

Permalink
Apply tls_verify and tls_cacerts config to ImageDownloader (sphinx-do…
Browse files Browse the repository at this point in the history
  • Loading branch information
ntouran committed Oct 9, 2023
1 parent bb74aec commit 5d69b5f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sphinx/transforms/post_transforms/images.py
Expand Up @@ -75,7 +75,10 @@ def handle(self, node: nodes.image) -> None:
timestamp: float = ceil(os.stat(path).st_mtime)
headers['If-Modified-Since'] = epoch_to_rfc1123(timestamp)

r = requests.get(node['uri'], headers=headers)
r = requests.get(
node['uri'], headers=headers,
_user_agent=self.app.config.user_agent,
_tls_info=(self.app.config.tls_verify, self.app.config.tls_cacerts))
if r.status_code >= 400:
logger.warning(__('Could not fetch remote image: %s [%d]') %
(node['uri'], r.status_code))
Expand Down

0 comments on commit 5d69b5f

Please sign in to comment.