简体   繁体   中英

PHP Curl error 60 querying reCAPTCHA API

I have a PHP site that queries several APIs via HTTPS. All work, except for reCAPTCHA. This produces the following error:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

A common solution to this problem is to download a .pem file from the curl site and add it to the PHP.ini file, which I did:

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo="/var/www/cacert.pem"

[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
openssl.cafile="/var/www/cacert.pem"

The error still happens. If I check phpinfo() the curl property is not set, but the openssl property is: PHPinfo文件 PHPinfo文件

I have restarted php-fpm and hard rebooted the server to no avail. There are no relevant errors in the startup log.

I am using PHP Version 7.2.4-1+ubuntu14.04.1+deb.sury.org+1

通过将OpenSSL升级到最新版本OpenSSL 1.1.0h 27 Mar 2018解决了此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM