使用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的更多相关文章

  1. SSL certificate problem: self signed certificate

    执行Git命令时出现各种 SSL certificate problem 的解决办法 2014年10月11日 10:45:40   比如我在windows下用git clone gitURL 就提示  ...

  2. 本地git安装完成之后,从远程git服务器上面下载代码。报错SSL certificate problem:self signed certificate in certificate chain。

    解决方案:打开git的控制端黑窗口,输入: git config --global http.sslVerify false 点击Entry之后,就会去掉git的ssl验证. 然后就可以正常的下载代码 ...

  3. git Clone SSL certificate problem: self signed certificate

    自己的git服务器遇到证书是自签的,git验证后会拒绝,此时,采用如下命令临时禁用就好 git -c http.sslVerify=false clone https://domain.com/pat ...

  4. jenkins 使用Git 报错:SSL certificate problem: self signed certificate in certificate chain

    在启动java的脚本上执行 增加参数: -Dorg.jenkinsci.plugins.gitclient.GitClient.untrustedSSL=true 即可!!

  5. PySpider 框架爬虫错误 HTTP 599: SSL certificate problem: unable to get local issuer certificate解决方案

    首先pyspider all启动pyspider的所有服务,然后访问http://localhost:5000创建一个爬虫任务:taobaomm,点开任务链接编辑http://localhost:50 ...

  6. 执行Git命令时出现 SSL certificate problem 的解决办法

    比如我在windows下用git clone gitURL 就提示  SSL certificate problem: self signed certificate 这种问题,在windows下出现 ...

  7. 执行Git命令时出现各种 SSL certificate problem 的解决办法

    执行Git命令时出现各种 SSL certificate problem 的解决办法 来源  https://www.cnblogs.com/chenzc/p/5842932.html 比如我在win ...

  8. PySpider HTTP 599: SSL certificate problem错误的解决方法

    在用 PySpider 爬取 https 开头的网站的时候遇到了 HTTP 599: SSL certificate problem: self signed certificate in certi ...

  9. PySpider HTTP 599: SSL certificate problem错误的解决方法(转)

    前言 最近发现许多小伙伴在用 PySpider 爬取 https 开头的网站的时候遇到了 HTTP 599: SSL certificate problem: self signed certific ...

随机推荐

  1. 使用 Drag and Drop 给Web应用提升交互体验

    什么是 Drag and Drop (拖放)? 简单来说,HTML5 提供了 Drag and Drop API,允许用户用鼠标选中一个可拖动元素,移动鼠标拖放到一个可放置到元素的过程. 我相信每个人 ...

  2. easypoi 版本依赖关系

    <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactI ...

  3. 小程序是单页面应用,有一个页面执行wx.showLoading(),其他页面也会显示

    my.js onLoad: function (options) { setTimeout(res=>{ wx.showLoading({ title: '10s后出现', }) }, ) }, ...

  4. css实现翻面效果

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. python学习_新闻联播文字版爬虫(V 1.0版)

    python3的爬虫练习,爬取的是新闻联播文字版网站 #!/usr/bin/env python # -*- coding: utf-8 -*- ''' __author__ = 'wyf349' _ ...

  6. [Python之路] 多种方式实现并发Web Server

    下面我们使用Python来实现并发的Web Server,其中采用了多进程.多线程.协程.单进程单线程非阻塞的方式. 一.使用子进程来实现并发Web Server 参照 https://www.cnb ...

  7. http 中文乱码

    string RawUrl = request.Request.RawUrl; string cc= HttpUtility.ParseQueryString(RawUrl.Substring(1, ...

  8. word粘贴图片到ckeitor

    在之前在工作中遇到在富文本编辑器中粘贴图片不能展示的问题,于是各种网上扒拉,终于找到解决方案,在这里感谢一下知乎中众大神以及TheViper. 通过知乎提供的思路找到粘贴的原理,通过TheViper找 ...

  9. CCPC-Wannafly & Comet OJ 夏季欢乐赛(2019)D

    题面 一开始想到一个 O(N^2) 做法,先把x排序,然后顺次枚举x最大的点,看向前最多可以保留多少点 (也就是先不管正方形的上下长度限制,先考虑左右的限制).然后再对这些点做一遍类似的..(等等这么 ...

  10. 『ZJOI2019 D2T2』语言

    ~~ 话说,本题考场想出三只\(log\)的暴力做法,被卡成暴力了.~~ 题目分析 首先考虑枚举每一个点,计算这个点可以和多少点进行交易. 将所有经过该点的路径\(s,t\)拿出,那么这些极远的\(s ...