Windows 下关于 CURL SSL 证书的放置说明

首先,我们从这个地址摸到 cacert.pem 文件:https://curl.haxx.se/docs/caextract.html

在 PHP 的配置文件 php.ini 中我们可以搜索 curl.cainfo 并通过填写正确的路径指向使得 ComposerCURL 能够正常请求

不过还有一个全局的更合理的方式,通过该链接:https://curl.haxx.se/docs/sslcerts.html

在其中搜索 CURL_CA_BUNDLE 我们可以得知:

If you're using the curl command line tool on Windows, curl will search for a CA cert file named "curl-ca-bundle.crt" in these directories and in this order:

	1. application's directory
	2. current working directory
	3. Windows System directory (e.g. C:\windows\system32)
	4. Windows Directory (e.g. C:\windows)
	5. all directories along %PATH%

如果您在 Windows 中使用 curl 命令行工具,curl 将在以下目录中按如下顺序搜索名为 curl-ca-bundle.crt 的 CA 证书文件:

	1. 应用程序目录
	2. 当前执行目录
	3. C:\Windows\System32
	4. C:\Windows
	5. 环境变量 %PATH% 中的所有路径

简单来说,我们其实不用去设置一些相关参数,直接将 cacert.pem 文件重命名为 curl-ca-bundle.crt 并扔到 C:\WindowsC:\Windows\System32 就行了。或是将此证书安装至 计算机 内的 受信任的根证书颁发机构 也可。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

至天

看心情啦,最好留着自己喝奶茶

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值