更新时间:2021-12-23 05:58:37
关于'SSL证书问题:无法获得本地颁发者证书'错误.需要注意的是,这适用于发送 CURL 请求的系统,而不是接收请求的服务器.
Relating to 'SSL certificate problem: unable to get local issuer certificate' error. It is important to note that this applies to the system sending the CURL request, and NOT the server receiving the request.
在 curl 命令中添加--cacert/path/to/cacert.pem"选项以告诉 curl 本地证书颁发机构文件的位置.
Add the '--cacert /path/to/cacert.pem' option to the curl command to tell curl where the local Certificate Authority file is.
(或)创建或添加到.curlrc"文件中的行:cacert =/path/to/cacert.pem
参见'man curl',关于'-K, --config
(or) Create or add to a '.curlrc' file the line:
cacert = /path/to/cacert.pem
See 'man curl', the section about the '-K, --config <file>' section for information about where curl looks for this file.
(或者如果使用 php)将以下行添加到 php.ini 中:(如果这是共享主机并且您无权访问 php.ini,那么您可以将其添加到 public_html 中的 .user.ini).
(or if using php) Add the following line to php.ini: (if this is shared hosting and you don't have access to php.ini then you could add this to .user.ini in public_html).
curl.cainfo=/path/to/downloaded/cacert.pem"
确保将路径用双引号括起来!!!