You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tls_verify and tls_cacerts configuration options are not applied to the requests call involved in the ImageDownloader. Thus, any configuration you set with those settings does not apply as expected during a build that involves downloading images. An example is if you're doing a make latex for source that refers to external images.
I've identified that the problem in the code is here:
Refer to an image on that server by https:// URL in ReST
run make latex
Observe error:
WARNING: Could not fetch remote image: https://self-signed.exampleserver.tld/user/174/files/978909e4-d1eb-422e-8be2-daf9c2fa9280 [HTTPSConnectionPool(host='self-signed.exampleserver.tld', port=443): Max retries exceeded with url: /user/174/files/978909e4-d1eb-422e-8be2-daf9c2fa9280 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))]
My particular use case where this is coming up is that I have some .md files with image Markdown in them pointing to external URLs, and when those come via myst_parser into sphinx and out to LaTeX, I'm seeing unexpected certificate errors.
The text was updated successfully, but these errors were encountered:
ntouran
added a commit
to ntouran/sphinx
that referenced
this issue
Oct 9, 2023
Describe the bug
The
tls_verify
andtls_cacerts
configuration options are not applied to therequests
call involved in theImageDownloader
. Thus, any configuration you set with those settings does not apply as expected during a build that involves downloading images. An example is if you're doing amake latex
for source that refers to external images.I've identified that the problem in the code is here:
sphinx/sphinx/transforms/post_transforms/images.py
Line 78 in bb74aec
c.f. where they are applied here:
sphinx/sphinx/ext/intersphinx.py
Lines 138 to 140 in bb74aec
I have a pull request in the works that fixes this.
This is, in essence, a needed follow-up to #3156.
How to Reproduce
tls_verify = False
inconf.py
make latex
Observe error:
WARNING: Could not fetch remote image: https://self-signed.exampleserver.tld/user/174/files/978909e4-d1eb-422e-8be2-daf9c2fa9280 [HTTPSConnectionPool(host='self-signed.exampleserver.tld', port=443): Max retries exceeded with url: /user/174/files/978909e4-d1eb-422e-8be2-daf9c2fa9280 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))]
Environment Information
Sphinx extensions
No response
Additional context
My particular use case where this is coming up is that I have some
.md
files with image Markdown in them pointing to external URLs, and when those come viamyst_parser
into sphinx and out to LaTeX, I'm seeing unexpected certificate errors.The text was updated successfully, but these errors were encountered: