建立于: 4年前 ( 更新: 4年前 )
出现了以下错误,如何修正
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)
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)
我们可以查看错误的路径中是否有这个CA档,没有换一个就好了,例如下方我换成了TWCA_Global_Root_CA.crt 。
例如:可在php.ini中新建设置
[openssl]
openssl.cafile=/usr/share/ca-certificates/mozilla/TWCA_Global_Root_CA.crt
openssl.capath=/etc/ssl/certs
重启后,可以用php命令在主机上检测是否更正了。
php -r "print_r(openssl_get_cert_locations());"
结果:
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
)
No Comment
Post your comment