We are having two domains ( both https ): one as main domain https://dev.project.com/ and the other for images https://dev-images.project.com/. The frontpage loads the images just fine, but I'm having this problem with file_get_contents
.
ErrorException in Collection.php line 228:
file_get_contents(): Unable to locate certificate CN
in Collection.php line 228
at HandleExceptions->handleError('2', 'file_get_contents(): Unable to locate certificate CN', '')
at file_get_contents('https://dev-images.project.com/images/12012_resized.jpg') in Collection.php line 228
The file itself exists and opens when checked in browser. I checked this solution, but all the tests are positive:
openssl: yes
http wrapper: yes
https wrapper: yes
wrappers: array (size=12) ...
php.ini
extension=php_openssl.dll
allow_url_fopen = On
The certificate is locally generated and set in php.ini
curl.cainfo = "D:\wamp64\cacert.pem"
My dev station has wamp64 server on Window10 with Php 5.6. Site is based on Laravel5.
Try to passing the path to your cafile like this.
edit: if this fails only in your local server, check if you have you added your locally created SSL cert in cacert.pem in your local server and that it contains no errors or extra lines.