herd-community icon indicating copy to clipboard operation
herd-community copied to clipboard

[Bug]: dompdf cannot access images with https

Open InforPsico opened this issue 8 months ago • 1 comments

Platform

Windows

Operating system version

Windows 10 21H2

System architecture

Windows

Herd Version

1.19.1

PHP Version

8.3.20

Bug description

I'm not sure if it's a bug, but it is a problem with Herd.

I have a Laravel project in which the images are stored outside of Laravel, specifically in project/public_html/img and on the server. Therefore, I can't change the image folder locally.

The images are displayed in the application without any issues using asset('img/image.png') and the browser renders them as proyect.test/img/image.png, displaying them correctly, as I said.

However, when embedding images in a PDF, dompdf doesn't seem to find them when I specify the path as asset('img/image.png') if I use https (with http it works)

When sending emails from my local machine, the images do appear correctly embedded in them, even using https, so it only fails in dompdf

In dompdf isRemoteEnabled is enabled in both projects. I'm not using barryvdh laravel-dompdf, but dompdf-dompdf

To provide more information, I created a new project that doesn't use Laravel. Specifically, it only uses HTML and PHP.

<img src="https://demo.test/img/logo.png" alt="test">

I call the image as usual, including its path (https://demo.test/img/logo.png).

The image is displayed in the browser in the generated HTML. It is not displayed in dompdf

Steps to reproduce

No response

Relevant log output


InforPsico avatar Apr 26 '25 11:04 InforPsico

Hm my only guess would be that dompdf is unable to properly locate the cacert.pem file and validate SSL certificates. Please see if there is an option to disable ssl verification in dompdf to see if this fixes the issue locally.

mpociot avatar May 26 '25 09:05 mpociot