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 ...
随机推荐
- 部署dashboard
1.获取k8s版本: 2.访问dashboard的github:https://github.com/kubernetes/dashboard/releases,然后找到对应的版本 3.然后将yaml ...
- php类知识---命名空间
<?php #命名空间namespace用来解决类的命名冲突,和引用问题 namespace trainingplan1; class mycoach { public function tra ...
- jmeter-请求头需要URIEncode编译时
使用函数 ${__urldecode()} 例如 :${__urldecode(%E4%BB%93%E5%BA%93)}${__urldecode(${参数变量})}
- linux命令系列
Linux系统安装node linux安装rz sz命令:yum install lrzsz上传tar包:rz node-v10.15.0-linux-x64.tar.xz将tar包移到上一级目录下: ...
- jQuery的replaceWith()函数用法详解
replaceWith,替换元素 replaceWith() 方法将选择的元素的内容替换为其他内容. 我们先在先看一个实例 <!DOCTYPE html> <html> < ...
- PHP处理kafka消息队列
在安装php-kafka 扩展后,就可以开始编写 php 消费消息的脚本了,php-rdkafka 扩展提供了几种消息处理的方式 低级方式(Low level) 这种方式没有消费组的概念 <?p ...
- Nginx配置中的log_format用法梳理
nginx服务器日志相关指令主要有两条,一条是log_format,用来设置日志格式,另外一条是access_log,用来指定日志文件的存放路径.格式和缓存大小,一般在nginx的配置文件中日记配置( ...
- JVM系列大纲
本系列主要分析JVM主要功能要点,初步大纲如下,会根据写作情况进行细化,目的在于梳理JVM的知识体系,具体分析文章会陆续发布. [JVM]类加载机制(1) [JVM]Java内存区域(2) [JVM] ...
- Tree-based Model 如何处理categorical variable
categorical variable 分为 order variale 和 non-order variable,其中order variable直接使用sklearn.preprocess.La ...
- cmake 工具使用
cmake_minimum_required(VERSION 3.5)#cmake版本 project( DisplayImage )#项目名称 find_package( OpenCV REQUIR ...