今天在用搜狐提供的邮件群发系统的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. hdu 5066 Harry And Physical Teacher(Bestcoder Round #14)

    Harry And Physical Teacher Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Ja ...

  2. 自定义View视图

    自定义View视图文件查找逻辑 之前MVC5和之前的版本中,我们要想对View文件的路径进行控制的话,则必须要对IViewEngine接口的FindPartialView或FindView方法进行重写 ...

  3. 查询出各个学科的前3名的同学信息的Sql

    查找各个学科的成绩前3名的学生信息Sql,有2种方法,一种是利用sql的row_number() over()函数,另一种是用子查询, 表设计如下 如果不考虑各个学科的成绩有并列的情况的话,有如下两种 ...

  4. VS2013打包部署(图解)

    首先要说明的是VS解决方案的配置Debug模式和Release有什么区别模式.Debug模式通常被称为调试模式,它包括调试信息,不优化的代码,序:Release模式通常叫做公布模式.不包括调试信息,可 ...

  5. Jquery--仿制360右下角弹出窗口

    原文:Jquery--仿制360右下角弹出窗口 先发浏览器效果图,给大家看. 要实现这样的效果,按照思路,第一步,写好CSS布局,将图片放到浏览器右下角的位置 CSS代码很灵活,我写的只是简单的一种而 ...

  6. opengl微开发之1-从零開始

    对OpenGL有一点了解之后,如今開始真正编写代码. 今天的内容: 使用FreeGLUT创建OpenGL的上下文环境 初始化GLEW 创建一个OpenGL的的模板范例 第一步: 一个OpenGL的上下 ...

  7. 将图片转为ASCII字符画

    原文:将图片转为ASCII字符画 Copyright 2012 Conmajia 源代码下载:点击这里 什么是字符画?就是用ASCII字符来近似组成图像,就像这样: ╭╮ ╭╮ ││ ││ ╭┴┴—— ...

  8. C控制语句--分支和跳转

    /*C控制语句--分支和跳转*/ /*关键字 if else switch continue break case default goto 运算符:&&(且) ||(或) ?:(三元 ...

  9. Set Matrix Zeroes -- LeetCode

    原题链接: http://oj.leetcode.com/problems/set-matrix-zeroes/ 这是一个矩阵操作的题目,目标非常明白,就是假设矩阵假设有元素为0,就把相应的行和列上面 ...

  10. 最新HTML BroadcastChannel API引荐

    HTML BroadcastChannel API 当前浏览器中只有Firefox38唯一能支持BroadcastChannel API(在编写本文的时间点),而Firefox38官方宣称要到2015 ...