cURL error 60: SSL certificate problem: self signed certificate in certificate chain

一、问题

cURL error 60: SSL certificate problem: self signed certificate in certificate chain - 服务器http302 出现这个一般是自签名证书的问题

二、解决

方案1.直接使用线上服务器带https的域名
方案2.windows本地开发环境解决方案

a)下载证书:
https://github.com/china-li-shuo/ca-cert

image.png

image.png

b)把下载的证书放到自己的php以下路径下:

D:\wamp64\bin\php\php7.3.21\extras\ssl这个是自己本地的php版本路径

image.png

c)修改php.ini文件

curl.cainfo ="D:\wamp64\bin\php\php7.3.21\extras\ssl\ca-cert.crt"
openssl.cafile="D:\wamp64\bin\php\php7.3.21\extras\ssl\ca-cert.crt"

image.png

d)重启php即可

猜你喜欢

转载自blog.csdn.net/weixin_43881802/article/details/120483881