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
Using FIPS-enabled libraries I get the following error trying to generate a PDF:
Traceback (most recent call last):
File "/workspace/test.py", line 2, in <module>
HTML('https://weasyprint.org/').write_pdf('/workspace/weasyprint-website.pdf')
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/__init__.py", line 259, in write_pdf
self.render(font_config, counter_style, **options)
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/__init__.py", line 216, in render
return Document._render(self, font_config, counter_style, options)
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/document.py", line 254, in _render
root_box = build_formatting_structure(
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/formatting_structure/build.py", line 62, in build_formatting_structure
box_list = element_to_box(
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/formatting_structure/build.py", line 185, in element_to_box
child_boxes = element_to_box(
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/formatting_structure/build.py", line 185, in element_to_box
child_boxes = element_to_box(
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/formatting_structure/build.py", line 185, in element_to_box
child_boxes = element_to_box(
[Previous line repeated 2 more times]
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/formatting_structure/build.py", line 253, in element_to_box
return html.handle_element(element, box, get_image_from_uri, base_url)
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/html.py", line 81, in handle_element
return HTML_HANDLERS[element.tag](
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/html.py", line 126, in handle_img
image = get_image_from_uri(
File "/workspace/.venv/lib/python3.10/site-packages/weasyprint/images.py", line 329, in get_image_from_uri
image_id = md5(url.encode()).hexdigest()
ValueError: [digital envelope routines] unsupported
As md5 function here is not used in a security context, we should set usedforsecurity=False argument to be able to generate pdf in a FIPS-enabled environment (See https://docs.python.org/3/library/hashlib.html non-cryptographic hash functions must use usedforsecurity=False).
The text was updated successfully, but these errors were encountered:
Using FIPS-enabled libraries I get the following error trying to generate a PDF:
As
md5
function here is not used in a security context, we should setusedforsecurity=False
argument to be able to generate pdf in a FIPS-enabled environment (See https://docs.python.org/3/library/hashlib.html non-cryptographic hash functions must use usedforsecurity=False).The text was updated successfully, but these errors were encountered: