...cURL error 60: SSL certificate problem: unable to get local issuer certificate...

  • 问题描述: 在做PHP爬虫的时候, 安装了 guzzle 和 dom-crawler 之后, 调用的时候出现问题, 如下
  • 报错内容:

    Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in E:\project\my_test\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:186 Stack trace: #0 E:\project\my_test\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(149): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 E:\project\my_test\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(102): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 E:\project\my_test\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #3 E:\project\my_test\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(28): GuzzleHttp\Handler in E:\project\my_test\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 186

    这是在Windows下PHPstudy环境测试的, 没有在Linux上试验, 不知道Linux会不会出现这样的错误. 这里只说Windows的解决方案, Linux如果出现大概也是同样的解决方法.

  • 下载cacert.pem, 下载地址: https://curl.haxx.se/ca/cacert.pem
  • 修改php.ini的curl配置, 找到 [curl] 模块, 如下

    [curl]
    ; A default value for the CURLOPT_CAINFO option. This is required to be an
    ; absolute path.
    ;curl.cainfo =

    将之前下载的cacert.pem的绝对路径复制到  ---->   curl.cainfo="cacert.pem绝对路径", 例如: E:\project\my_test\curl_cainfo\cacert.pem 然后去掉注释, 重启PHPstudy.

原文地址:https://www.cnblogs.com/bneglect/p/11679274.html

时间: 2024-11-11 14:57:08

...cURL error 60: SSL certificate problem: unable to get local issuer certificate...的相关文章

curl: (60) SSL certificate problem: unable to get local issuer certificate 错误

今天同事做微信管理的项目,请求接口返回如下错误SSL certificate problem: unable to get local issuer certificate. 此问题的出现是由于没有配置信任的服务器HTTPS验证.默认,cURL被设为不信任任何CAs,就是说,它不信任任何服务器验证.因此,这就是浏览器无法通过HTTPs访问你服务器的原因. 解决此报错有2种处理方法 1.如果你的内容不敏感,一个快捷的方法是使用curl_exec()之前跳过ssl检查项. curl_setopt($

curl SSL certificate problem: unable to get local issuer certificate 错误的解决方法

报错信息为atal error: Uncaught exception 'Exception' with message 'SSL certificate problem: unable to get local issuer certificate' in......解决办法在php.ini 找到curl.cainfo = "d:/wamp/bin/php/php5.5.12/cacert.pem"证书下载地址: http://curl.haxx.se/ca/cacert.pem

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

参考  http://blog.csdn.net/mazicwong/article/details/54946952 1.到https://curl.haxx.se/ca/cacert.pem复制下文本粘贴到文件夹cart.pem 然后把catr.pem放到php的bin目录下  我用的是phpstudy  应该放到D:\phpStudy\Apache\bin 目录 2. 在php.ini中修改下面这句话,把前面分号删掉,分号是省略,然后后面天上自己cacert.pem文件的路径,重启phps

cURL error 60: SSL certificate problem: unable to get local issuer certificate(转)【亲测】

php5.6以上的版本会出现这种问题 解决办法: [开启拓展] extension=curl extension=openssl [配置证书] 访问https://curl.haxx.se/docs/caextract.html,下载cacert.pem,并在php.ini文件添加 curl.cainfo="XXXXXXX/cacert.pem"   //配置相应的路径 openssl.cafile="XXXXXXX/cacert.pem"   //配置相应的路径

解决Twilio本地Postman请求时报错SSL certificate problem: unable to get local issuer certificate

http://www.shuijingwanwq.com/2018/02/28/2406/ https://curl.haxx.se/docs/caextract.html 编辑 php.ini,修改 ;curl.cainfo = 为 curl.cainfo = “C:\php-7.1.12\extras\ssl\cacert.pem” 原文地址:https://www.cnblogs.com/denghuachengle/p/11682209.html

php SSL certificate problem: unable to get local issuer certificate

加上 curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE); 就可以了 百度语音的demo: <?php header("Content-type:audio/mp3; charset=utf-8"); //put your params here $cuid = "9619439"; $apiKey = "gSwM3lYXkKXp5dDuU6zBjHrr"; $secretKey = "ff

SSL certificate problem: unable to get local issue

今天在使用git克隆一个库的时候,报错如下: 正克隆到 'lepus'... fatal: unable to access 'https://github.com/ruzuojun/lepus.git/': SSL certificate problem: unable to get local issuer certificate 隐隐约约记得之前遇到过这种报错,但忘了解决办法,于是上网搜索一波.发现是https访问的的证书问题,我就使用命令直接去掉ssl的验证,问题解决. 解决方法: [[

php 发邮件报错unable to get local issuer certificate

发邮件的时候报错,邮件无法发送:SSL certificate: unable to get local issuer certificate 在Windows下,curl找不到CA证书去验证对方的证书! 方法一:(极度不推荐,不安全) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 方法二: It's easy to fix (php 5.3.7 or higher) - Download a list file with an up-to-d

freeradius 错误: error:140890C7:SSL routines:ssl3_get_client_certificate:peer did not return a certificate

在进行802.1x 测试时遇到如下问题: Waking up in 4.6 seconds.(156) Received Access-Request Id 82 from 192.168.1.126:44896 to 192.168.1.122:1812 length 524(156)   User-Name = "dddddd"(156)   Called-Station-Id = "70-CC-CC-E3-00-91:myssid"(156)   NAS-Po