0

I change my server and now I have some problem with the function fsockopen() and file_get_contents()

I always has this error :

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /home/curl.php on line 6

I know I can tell by the code to not verify the peer and trust certificate, but I'm pretty sure I have a problem of configuration in my php. I have already configured the openssl.cafile in php.ini with the last pem

If any one has a solution and could help me, I'll appreciate it.

Thank you

Chatis
  • 47
  • 2
  • 11
  • I assume you fully stopped and restarted the web server after making the change in your `php.ini` file to add the require CAs, correct? – jaswrks Nov 05 '17 at 12:23
  • Yeah I did the restart – Chatis Nov 05 '17 at 12:39
  • Have you confirmed that your SSL certificate is working without issue by running your site through a series of tests here? https://www.ssllabs.com/ssltest/ – jaswrks Nov 05 '17 at 12:42
  • Overall rating : a – Chatis Nov 05 '17 at 12:55
  • Nice. Run a test by inspecting the output of this function, so you can confirm that all of these locations that PHP has, do exist. See: http://php.net/manual/en/function.openssl-get-cert-locations.php – jaswrks Nov 05 '17 at 13:02
  • Yeah already done, and all is ok – Chatis Nov 05 '17 at 13:04
  • Is it possible that the `openssl.cafile` that you've configured contains only major trusted authorities, but is perhaps missing the authority that signed your certificate? See: https://stackoverflow.com/a/32366242/1219741 – jaswrks Nov 05 '17 at 13:10
  • I took this one : https://curl.haxx.se/docs/caextract.html – Chatis Nov 05 '17 at 13:13
  • Something can help you : when I put the cert.pem from the CA, fsockopen works well now, but file_get_contents() still not working – Chatis Nov 05 '17 at 13:14

0 Answers0