PHP curl出现SSL certificate problem: self signed certificate in certificate chain
使用PHP curl请求https的时候出现错误“SSL certificate problem: self signed certificate in certificate chain”,这种情况是无法验证客户端根证书导致,解决办法如下。

方法一
忽略证书验证,在curl方法中添加以下代码即可。
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
缺点: 每个curl方法中都要添加上面的方法,有点麻烦。
方法二:
从curl官方网站,下载根证书:cacert.pem ,然后修改php.ini中加入该证书,并重启web服务。
#在php.ini中加入
[SSL]
curl.cainfo = "D:\xampp\php\cacert.pem"
openssl.cafile = "${curl.cainfo}"
PHP curl出现SSL certificate problem: self signed certificate in certificate chain的更多相关文章
- SSL certificate problem: self signed certificate
执行Git命令时出现各种 SSL certificate problem 的解决办法 2014年10月11日 10:45:40 比如我在windows下用git clone gitURL 就提示 ...
- 本地git安装完成之后,从远程git服务器上面下载代码。报错SSL certificate problem:self signed certificate in certificate chain。
解决方案:打开git的控制端黑窗口,输入: git config --global http.sslVerify false 点击Entry之后,就会去掉git的ssl验证. 然后就可以正常的下载代码 ...
- git Clone SSL certificate problem: self signed certificate
自己的git服务器遇到证书是自签的,git验证后会拒绝,此时,采用如下命令临时禁用就好 git -c http.sslVerify=false clone https://domain.com/pat ...
- jenkins 使用Git 报错:SSL certificate problem: self signed certificate in certificate chain
在启动java的脚本上执行 增加参数: -Dorg.jenkinsci.plugins.gitclient.GitClient.untrustedSSL=true 即可!!
- PySpider 框架爬虫错误 HTTP 599: SSL certificate problem: unable to get local issuer certificate解决方案
首先pyspider all启动pyspider的所有服务,然后访问http://localhost:5000创建一个爬虫任务:taobaomm,点开任务链接编辑http://localhost:50 ...
- 执行Git命令时出现 SSL certificate problem 的解决办法
比如我在windows下用git clone gitURL 就提示 SSL certificate problem: self signed certificate 这种问题,在windows下出现 ...
- 执行Git命令时出现各种 SSL certificate problem 的解决办法
执行Git命令时出现各种 SSL certificate problem 的解决办法 来源 https://www.cnblogs.com/chenzc/p/5842932.html 比如我在win ...
- PySpider HTTP 599: SSL certificate problem错误的解决方法
在用 PySpider 爬取 https 开头的网站的时候遇到了 HTTP 599: SSL certificate problem: self signed certificate in certi ...
- PySpider HTTP 599: SSL certificate problem错误的解决方法(转)
前言 最近发现许多小伙伴在用 PySpider 爬取 https 开头的网站的时候遇到了 HTTP 599: SSL certificate problem: self signed certific ...
随机推荐
- 使用CreateWindowEx创建子窗口的注意事项
比如: 使用 HWND child = CreateWindowEx(0,L"childclass",NULL,WS_CHILD | WS_VISIBLE | WS_CLIPSIB ...
- Atcoder CODE FESTIVAL 2016 Final G - Zigzag MST[最小生成树]
题意:$n$个点,$q$次建边,每次建边选定$x,y$,权值$c$,然后接着$(y,x+1,c+1),(x+1,y+1,c+2),(y+1,x+2,c+3),(x+2,y+2,c+4)\dots$(画 ...
- Linux下DB2指令总结
1.显示当前实例 >> get instance The current database manager instance is: db2axing 2.列出当前实例中激活的数据库 &g ...
- mysql 模拟oracle中的序列
因业务需要,把oracle 数据据转成mysql,同时oracle中程序本来一直在用 序列, mysql中没有,所以需要在mysql中新建一个表进行模拟, CREATE TABLE `sequence ...
- Java-FtpUtil工具类
package cn.ipanel.app.newspapers.util; import java.io.BufferedReader; import java.io.DataInputStream ...
- Acwing-197-阶乘分解(质数)
链接: https://www.acwing.com/problem/content/199/ 题意: 给定整数 N ,试把阶乘 N! 分解质因数,按照算术基本定理的形式输出分解结果中的 pi 和 c ...
- CentOS下安装libjpeg库及编译GD库
GD库明明安装了,可处理图片的时候还是报错 Fatal error: Call to undefined function imagecreatefromjpeg() .PHP安装后,默认的gd库不支 ...
- Linux命令(Ubuntu)
VMware 打开命令模式快捷键: Ctrl + Alt + T VMware 里面Ubuntu不能全屏, 本来想着习惯就好, 知道今天看一些信息不能全部显示, 最终不能忍了. 上网找了很多方法 主 ...
- Python 运算符优先级
这个表给出Python的运算符优先级(从低到高). 从最低的优先级(最松散地结合)到最高的优先级(最紧密地结合). 这意味着在一个表达式中,Python会首先计算表中较下面的运算符,然后在计算列在表上 ...
- python学习用到的网站
官方地址:https://www.python.org/ 玩蛇网:http://www.iplaypython.com/