I have an HTML page I want to convert to PDF using the Weasyprint CLI. The page references images and CSS files by relative path. When I run the command weasyprint --stylesheet main.css file.html file.pdf
, it generates the PDF but the images are not included and the verbose output shows this error:
ERROR: Failed to load image at ‘file:///path/to/file.png’: SSLError: [CRYPTO] unknown error (_ssl.c:3076)
It’s also throwing the same error for the CSS file, although the CSS styles still appear to be applied:
ERROR: Failed to load stylesheet at file:///path/to/main.css: SSLError: [CRYPTO] unknown error (_ssl.c:3076)
I don’t see why there would be any SSL issues looking up a local file? What’s causing this error and how do I fix it?