0

I am working to set up PayPal's PHP orders SDK. I am running into PayPalHttp\IOException: SSL certificate problem: unable to get local issuer certificate.

Which I know to be an issue with me missing the cacert.pem file. I've got the file, but I'm not exactly sure how to link it so that PayPal's code can use it.

Nowhere in their documentation does PayPal mention these certificates, so it seems weird that their SDK wouldn't just come bundled with them since they rely on cURL.

I am not otherwise using cURL, so I'm not sure the best way to provide the file path other than to go in and directly modify PayPal's source code which just feels wrong. There is, buried deep in their source code and not mentioned whatsoever in their documentation, the function stub HttpClient::getCACertFilePath(), but again, having to modify a third party's source code seems like a bad solution, especially when it could potentially be a different path my development machine to production.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
cebo
  • 688
  • 1
  • 8
  • 26
  • Just point `curl.cainfo` in your `php.ini` to the certificate bundle as in the duplicate. You should also update `openssl.cafile` to the same value, for libraries not using cURL. – miken32 Apr 28 '21 at 20:53
  • Re *"it could potentially be a different path my development machine to production"*: One or more words seem to be missing. Please respond by [editing your question](https://stackoverflow.com/posts/67307234/edit) (***without*** "Edit:", "Update:", or similar - the question should appear as if it was written today). – Peter Mortensen Jun 17 '21 at 11:56

0 Answers0