I found a solution to this
I'm running:
FreeBSD 10.1
Apache2.4
PHP 5.6.3
To find the CA file I ran this command
locate cacert.pem
Result was:
/usr/local/lib/perl5/site_perl/5.16/Mozilla/CA/cacert.pem
Then open the php.ini file and change this:
;openssl.cafile=
To this:
openssl.cafile=/usr/local/lib/perl5/site_perl/5.16/Mozilla/CA/cacert.pem
Note: This directive is only available on php 5.6.x
Then restart Apache