已忽略PHP CURL CURLOPT_SSL_VERIFYPEER [英] PHP CURL CURLOPT_SSL_VERIFYPEER ignored

查看:1658
本文介绍了已忽略PHP CURL CURLOPT_SSL_VERIFYPEER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些原因,我无法使用CURL与HTTPS。一切工作正常,直到我运行升级curl库。现在我在尝试执行CURL请求时遇到此响应: SSL CA证书(路径?访问权限?)有问题



发布在相关问题我试图做以下:




$ b b

Unfortunatelly以上都不能解决我的问题,我不断得到SSL CA证书(路径?访问权限?)消息。



我不需要这个验证(我知道安全问题)。



有人有任何其他建议吗?



UPDATE



更新到最新的库并重新启动整个框,而不仅仅是我正在做的apache

解决方案

根据文档:要验证主机或对等证书,您需要指定



还可以查看CURLOPT_SSL_VERIFYHOST:1来检查SSL中是否存在公共名称。CURLOPT_CAINFO选项或证书目录的备用证书可以使用CURLOPT_CAPATH选项指定。对等证书。 2检查是否存在通用名称,并验证其是否与提供的主机名匹配。

  curl_setopt($ ch,CURLOPT_SSL_VERIFYHOST, 0); 
curl_setopt($ ch,CURLOPT_SSL_VERIFYPEER,0);


For some reason I am unable to use CURL with HTTPS. Everything was working fine untill I ran upgrade of curl libraries. Now I am experiencing this response when trying to perform CURL requests: Problem with the SSL CA cert (path? access rights?)

Following suggestions posted here on related issues I have tried to do the following:

Unfortunatelly none of the above are able to solve my problem and I constantly get Problem with the SSL CA cert (path? access rights?) message.

And I don't need this verification in the first place (I am aware of security issues).

Does anybody have any other suggestions?

UPDATE

After updating to the latest libraries and restart of the whole box, not just apache which I was doing it all seems to be working now again!!!

解决方案

According to documentation: to verify host or peer certificate you need to specify alternate certificates with the CURLOPT_CAINFO option or a certificate directory can be specified with the CURLOPT_CAPATH option.

Also look at CURLOPT_SSL_VERIFYHOST: 1 to check the existence of a common name in the SSL peer certificate. 2 to check the existence of a common name and also verify that it matches the hostname provided.

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

这篇关于已忽略PHP CURL CURLOPT_SSL_VERIFYPEER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆