by Devin Yang
(This article was automatically translated.)

Published - 4 years ago ( Updated - 4 years ago )

The following error occurred, how to fix it
GuzzleHttp \ Exception \ RequestException
cURL error 77: error setting certificate verify locations: CAfile: /usr/share/ca-certificates/mozilla/ComSign_CA.crt CApath: /etc/ssl/certs (see http://curl.haxx.se/libcurl/c/ libcurl-errors.html)

We can check whether there is this CA file in the wrong path, if not, just change it, for example, I replaced it with TWCA_Global_Root_CA.crt below.
For example: new settings can be added in php.ini
[openssl]
openssl.cafile=/usr/share/ca-certificates/mozilla/TWCA_Global_Root_CA.crt
openssl.capath=/etc/ssl/certs
After restarting, you can use the php command to check whether it has been corrected on the host.
php -r "print_r(openssl_get_cert_locations());"
result:
Array
(
    [default_cert_file] => /usr/lib/ssl/cert.pem
    [default_cert_file_env] => SSL_CERT_FILE
    [default_cert_dir] => /usr/lib/ssl/certs
    [default_cert_dir_env] => SSL_CERT_DIR
    [default_private_dir] => /usr/lib/ssl/private
    [default_default_cert_area] => /usr/lib/ssl
    [ini_cafile] => /usr/share/ca-certificates/mozilla/TWCA_Global_Root_CA.crt
    [ini_capath] => /etc/ssl/certs
)




 

Tags: php openssl curl

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments