今天在用搜狐提供的邮件群发系统的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. 深入了解setInterval方法

    相信大家对setInterval方法肯定非常熟悉,但不少人对其缺乏深入的了解,致使当一个flash里有多个setInterval的时候就容易混淆,该清除的间隔lID没有清除,不该清除的时候却清除了.对 ...

  2. axure团队合作开发原型图

    谁是人画或其他原型图的头,但在基本制度的发展时,.我们分配一些人画的原型,其他部分干. 再画一个原型不再是一个人画,一起画,假设大家都各自画自己那一部分.最后再由一个人来整合的画.是非常麻烦. 咱平时 ...

  3. 它们的定义app.config中间section节点和在执行中使用

    如果现在我们需要在app.config一个节点的在下面的例子中,定义,我们需要如何进行操作? <configSections> <section name="integra ...

  4. Java设计模式偷跑系列(21)建模和实现享受metapatterns

    转载请注明出处:http://blog.csdn.net/lhy_ycu/article/details/40021651 享元模式(Flyweight):运用共享的技术有效地支持大量细粒度的对象. ...

  5. java中文件的相对路径以及jar中文件的读取

    Java中File类的构造函数需要我们传入一个pathname,当我们传入以"/"开头的pathname表示绝对路径,其他均表示相对路径. 一:绝对路径名:是完整的路径名,不需要任 ...

  6. 电脑报2014年第43期 pdf高清版

    电脑报2014年第43期 pdf高清版

  7. POJ 3176-Cow Bowling(DP||记忆化搜索)

    Cow Bowling Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 14210   Accepted: 9432 Desc ...

  8. 代理模式与Android

    代理模式(Proxy) 一.   什么是代理模式 先来看看官方的说法,代理模式就是为其它对象提供一种代理,以控制对这个对象的訪问. 看来这个官方的说法的确有点官方,看了还是让人感觉不点不知所措,还是不 ...

  9. javascript1

    <script> //初始化表达式:通过方括号定义数组元素和通过花括号定义对象属性名和属性值之间的映射关系的语法 //通过“.”和“[]”来引用对象属性或数组元素的值就构成一个表达式. v ...

  10. jQuery实现表格行的动态增加与删除

    删除之前删除2行后: 1<script> 8 $(document).ready(function(){ 9 //<tr/>居中 10 $("#tab tr" ...