I understand that I can set the option on any specific instance, however what I would really like is to set something up php.ini or somewhere similar which will handle this across all projects and all instances.
Does anyone know a way for me to accomplish this?
EDIT: I am particularly interested in a solution which will allow for the certificates to be in different locations on different servers.
I am developing on a Windows machine which needs this but deploying to a Linux server which not only doesn't need it but doesn't even have the path indicated.
I understand that I can use conditions to check where the code is running but would prefer to just have it work out of the box. It seems to me that this is really an issue for curl and PHP to handle rather than my code and hence the settings for it belong there.
I found the answer here (in the user notes): http://php.net/manual/en/function.curl-setopt.php
Just add this to you .ini (note: you cannot use ini_set
, although I don't know why you would want to. Thanks @Carlton):
curl.cainfo=c:\php\cacert.pem
And get that file from: http://curl.haxx.se/docs/caextract.html
Works and you aren't opening yourself up for MITM attacks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With