本地请求接口报SSL错误解决办法(Could not verify * SSL certificate)

问题

在请求第三方接口时,本地开发中由于本地没有安装curl证书,如果不关闭SSL 验证就会报SSL验证错误:

Could not verify SSL certificate. Please make sure that your network is not intercepting certificates. (Try going to https://checkout-test.*** in your browser.) If this problem persists;

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://***.com/

解决办法:

  1. 下载最新的 CA bundle 文件:

    复制代码
    👉 https://curl.se/ca/cacert.pem
    
    放到例如:
bash 复制代码
C:\php\extras\ssl\cacert.pem
  1. 修改 php.ini(找到并取消注释 / 添加以下行):
php 复制代码
[curl]
curl.cainfo = "C:\php\extras\ssl\cacert.pem"

[openssl]
openssl.cafile = "C:\php\extras\ssl\cacert.pem"
  1. 重启 Apache 或 PHP-FPM。
相关推荐
车载测试工程师4 分钟前
CAPL学习-ETH功能函数-概述
网络协议·can·以太网·capl·canoe
科技块儿23 分钟前
常见IP归属地数据库对比
网络·数据库·tcp/ip
xixixi777771 小时前
剖析Agent(代理)攻击面
网络·学习·安全·架构·网络攻击模型·代理
8K超高清1 小时前
超高清科技引爆中国电影向“新”力
大数据·运维·服务器·网络·人工智能·科技
bloglin999991 小时前
ssl和tls加密
网络·网络协议·ssl
Jerry.张蒙1 小时前
SAP传输请求流程:从开发到生产的安全流转
大数据·网络·人工智能·学习·职场和发展·区块链·运维开发
闲人编程1 小时前
HTTP协议深度解析与RESTful API设计
网络协议·http·restful·url·接口设计·codecapsule
繁华似锦respect1 小时前
C++ 设计模式之工厂模式详细介绍
java·linux·c++·网络协议·设计模式
va学弟1 小时前
TCP 与 UCP 比较
服务器·网络·tcp/ip
aodunsoft2 小时前
安全月报 | 傲盾DDoS攻击防御2025年11月简报
网络·安全·ddos