Skip to content
Advertisement

openssl.cafile with no value for web requests only

In a fresh Valet installation I’ve updated within my php.ini:

openssl.cafile = "/usr/local/etc/openssl@1.1/cert.pem"

Then, within my Laravel public/index.php I’m outputting my phpinfo(); on line 1.

If I then perform a request via Postman I can see:

JavaScript

However the expected result I can see via tinker is:

JavaScript

As far as I understand both requests should load the same file, yet that doesn’t happen.

In both cases loaded php.ini is the same:

JavaScript
JavaScript

I’ve already tried copying the pem to a different folder, but either way it’s not loaded for web requests. What can I do?

Advertisement

Answer

Still don’t know what the reason for this is, but as a workaround I’ve:

  • copied /usr/local/etc/openssl@1.1/cert.pem to /usr/local/etc/php/7.4/cacert.pem
  • set curl.cainfo = "/usr/local/etc/php/7.4/cacert.pem" within my php.ini file

This way at least given file is always included

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement