问题描述
项目中使用GuzzleHttp请求 https 时会报错:
GuzzleHttp\Exception\RequestException : cURL error 60: SSL certificate problem: certificate has expired (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)’
解决方案
1.下载新的CA证书
官网地址:https://curl.se/docs/caextract.html
下载地址:https://curl.se/ca/cacert.pem
下载成功后,将证书文件保存到任意位置
2.修改php.ini
在php.ini中[curl]和[openssl]修改curl.cainfo和openssl.cafile和openssl.capath,指向到保存的证书cacert.pem地址
- curl
- openssl