Today, I encountered a problem with the client application server (CentOS). When using getimagesize(), an error is always reported:
PHP getimagesize(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_ get_ server_ certificate:certificate verify failed
It is preliminarily judged that openssl.cafile in php.ini is not set. After opening the PHP configuration file, it is found that it is set. The current setting value is:
openssl.cafile=/etc/pki/tls/certs/ca-bundle.crt
After that, it was suspected that the certificate might expire. First, compare the contents of the file on your own server. If you find that the size is inconsistent, copy and paste the contents from your own server. After saving, the problem of reloading PHP configuration still exists;
Remember that similar problems have occurred on Windows systems before. At that time, curl.cainfo
was configured, so from this website
: http://curl.haxx.se/ca/cacert.pem Download the certificate and put it in the /usr/local/OpenSSL/
directory to modify the configuration
[curl]
curl.cainfo = /usr/local/openssl/cacert.pem
[openssl]
openssl.cafile=/usr/local/openssl/cacert.pem
When this problem occurs on the Internet, the solutions found are also operated in this way. However, the overload configuration problem remains after saving. Change the configuration back again.
Finally, see this article on: https://stackoverflow.com/questions/17084886/ssl-error-routinesssl3-get-server-certificatecertificate-verify-failed
It is found that the Linux system has the command to update the local certificate. The commands are different for different systems. The CentOS operation is as follows:
#Install ca certificate tool
yum install ca-certificates -y
# Update Certificate
update-ca-trust
Problem-solving.