今天在用搜狐提供的邮件群发系统的sdk,做发送邮件的测试时,提示:

last error : SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

sdk代码如下:

   <?php
send_mail(); function send_mail() {
$ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_URL, 'https://sendcloud.sohu.com/webapi/mail.send.json');
//不同于登录SendCloud站点的帐号,您需要登录后台创建发信子帐号,使用子帐号和密码才可以进行邮件的发送。
curl_setopt($ch, CURLOPT_POSTFIELDS,
array('api_user' => 'xxxx@xxx.org',
'api_key' => 'password',
'from' => 'xx@qq.com',
'fromname' => 'SendCloud团队',
'to' => 'lidongjun@huanqiu.com',
'subject' => 'php 调用WebAPI测试主题',
'html' => '欢迎使用<a href="https://sendcloud.sohu.com">SendCloud</a>',
//'file1' => '@/path/to/附件.png;filename=附件.png',
//'file2' => '@/path/to/附件2.txt;filename=附件2.txt'
));
//设置对ssl不进行证书校验
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); $result = curl_exec($ch); if($result === false) //请求失败
{
echo 'last error : ' . curl_error($ch);
} curl_close($ch); return $result;
}
?>

错误的提示时ssl验证不通过,解决办法

使用curl如果想发起的SSL请求正常的话有2种做法:

方法一、设定为不验证证书和host。

在执行curl_exec()之前。设置option

$ch = curl_init();

......

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 方法二、设定一个正确的证书。 本地ssl判别证书太旧,导致链接报错ssl证书不正确。 我们需要下载新的ssl 本地判别文件 http://curl.haxx.se/ca/cacert.pem 放到 程序文件目录 curl 增加下面的配置 curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,true); ;
curl_setopt($ch,CURLOPT_CAINFO,dirname(__FILE__).'/cacert.pem');

last error : SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate veri的更多相关文章

  1. git clone 出错SSL certificate problem, verify that the CA cert is OK.

    先调用这个 export GIT_SSL_NO_VERIFY=true 之后再执行git clone

  2. cURL error 60: SSL certificate problem...

    php在curl的时候报错 cURL error 60: SSL certificate problem: unable to get local issuer certificate (see ht ...

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

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

  4. cURL error 60: SSL certificate problem: unable to get local issuer certificate 解决方法

    微信开发的时,请求接口报错如下: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see ...

  5. 【error】git clone: SSL certificate problem: unable to get local issuer certificate

    报错: $ git clone https://github.XXX.git Cloning into 'XXX'... fatal: unable to access 'https://github ...

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

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

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

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

  8. curl: (60) SSL certificate problem: unable to get local issuer certificate

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html 内部邀请码:C8E245J (不写邀请码,没有现金送) 国 ...

  9. SSL certificate problem unable to get local issuer certificate解决办法

    SSL certificate problem unable to get local issuer certificate 解决办法: 下载:ca-bundle.crt 将它放在自己的wamp或者x ...

随机推荐

  1. JS动态获取浏览器宽度和高度

    $(window).resize(function() { var width = $(this).width(); var height = $(this).height(); });

  2. JS脚本显示当前日期+星期几[转]

    以下的代码提供了显示当前日期和星期几的实现方法: function writeDateInfo() {         var day="";         var month= ...

  3. SettingsProvider该CRUD

    转载请注明出处:http://blog.csdn.net/droyon/article/details/35558697 什么时候delete要么update时间.需要清空缓存并重新加载数据. 1.i ...

  4. 【高德地图API】从零开始学高德JS API(四)搜索服务——POI搜索|自动完成|输入提示|行政区域|交叉路口|自有数据检索

    原文:[高德地图API]从零开始学高德JS API(四)搜索服务——POI搜索|自动完成|输入提示|行政区域|交叉路口|自有数据检索 摘要:地图服务,大家能想到哪些?POI搜素,输入提示,地址解析,公 ...

  5. 【地图API】为何您的坐标不准?如何纠偏?

    原文:[地图API]为何您的坐标不准?如何纠偏? 摘要:各种坐标体系之间如何转换?到底有哪些坐标体系?什么是火星坐标?为什么我的坐标,在地图上显示会有偏移?本文详细解答以上问题.最后给出坐标拾取工具. ...

  6. easyui datagrid 单元格编辑 即见即所得,MVC菜单维护,扫描增加

    效果如图: 参见 EasyUI 官方 Demo 及文档 @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Lay ...

  7. POJ 1565 Skew Binary(简单的问题)

    [简要题意]:第二个是数字系统的代表性的定义.而给了你这个号码系统提示的形式和十进制转换之间的关系.现在给你一些这样的系统.让你把它变成2二进制输出. [分析]:当中 base[k]  =  2^(k ...

  8. STL容器存储的内容动态分配情况下的内存管理

    主要分两种情况:存储的内容是指针:存储的内容是实际对象. 看以下两段代码, typedef pair<VirObjTYPE, std::list<CheckID>*> VirO ...

  9. Git 一些常见的命令

    git branch 查看本地所有分支 git status 查看当前状态 git commit 提交 git branch -a 查看所有的分支 git branch -r 查看远程所有分支 git ...

  10. Nagios监控lvs服务

    1在lvs server上安装nrpe客户端: 1.1,rpm方式安装nrpe客户端 下载地址:http://download.csdn.net/detail/mchdba/7493875 [root ...