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

[Bug]: Problem with certificate SSL

Open xr0m3oz opened this issue 4 months ago • 6 comments

Platform

macOS

Operating system version

ventura 13.7.4

System architecture

Intel (x86)

Herd Version

1.22.1

PHP Version

7.4

Bug description

I installed the framework yii2, made a custom driver for it. Everything seemed to start. But the problem is when I connect the certificate to the site, it seems to have been installed. At the same time, when I go to some pages of the site where there are images that are loaded via PHP, it says that the certificate is invalid.

Image

Steps to reproduce

No response

Relevant log output


xr0m3oz avatar Aug 23 '25 11:08 xr0m3oz

I would also like to note that the certificate issue only works if the main version is 8.4; certificate issue does not work on 7.4.

xr0m3oz avatar Aug 23 '25 12:08 xr0m3oz

Which URL are you trying to access? Is it a local one with a self-signed SSL certificate from Herd?

mpociot avatar Aug 25 '25 13:08 mpociot

Yes, .test site from herd domain.

xr0m3oz avatar Aug 25 '25 16:08 xr0m3oz

I've experienced a similar error when using file_get_contents which uses PHP's OpenSSL extension to find the Certificate Authority for sites generated by Herd.

It seems the OpenSSL extension looks in the cacert.pem (for me, found in "/Users/{username}/Library/Application Support/Herd/config/php/cacert.pem" for the Laravel Valet CA Self Signed CN certificate; this doesn't appear to be put there by Herd.

I can temporarily resolve the OpenSSL verify failed issue following these steps:

  1. Open KeyChain Access on your Mac.
  2. Search for "Laravel Valet CA Self Signed CN".
  3. File -> Export as PEM "Laravel Valet CA Self Signed CN.pem"
  4. Copy the contents of the file to your clipboard.
  5. Open the cacert.pem file linked to from your php.ini file (you can find the path by running php --ini). e.g. "/Users/{username}/Library/Application Support/Herd/config/php/cacert.pem"
  6. Paste the contents of the file at the end of the cacert.pem file and save
Image

LarsaSolidor avatar Aug 26 '25 08:08 LarsaSolidor

Thanks @LarsaSolidor , that seems to work.

@mpociot why is the Laravel Valet CA Self Signed CN certificate missing from the ca bundle?

jason-nabooki avatar Sep 11 '25 04:09 jason-nabooki

@jason-nabooki hm that's a good question 🤔 Do you think that always adding this will cause any issues that we currently don't have?

mpociot avatar Oct 30 '25 09:10 mpociot