使用curl发请post请求的时候,会遇到如下错误:

curl: (60) SSL certificate problem: self signed certificate

More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

查看官网的解释是说因为证书认证缺失,所以可以考虑请求里面关闭ssl证书认证,命令行中加上-k即可,如

curl -d "a=test1&b=fu&c=tet2" https://testtest.com/test/test2/getUserInfo -k

如果是在php代码中,则需要加入下面的代码:

if(substr($url,0,5) == 'https'){
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);
}

参考资料:

https://curl.haxx.se/docs/sslcerts.html

curl报错60的问题的更多相关文章

  1. php curl报错:417 - Expectation Failed

    当我在post提交的数据增加一段内容后会报错:417 - Expectation Failed. 查资料发现在使用curl做POST时,当post的数据大于1024字节时,curl并不会直接发起pos ...

  2. php网站修改为https后curl报错301

    今日测试项目时需调用post模拟传参测试接口是否可用,但返回报错信息(301永久迁移),在网上搜寻解决办法无果,最后发现只要将跳转地址修改为https://+url的形式就可以了

  3. PHP curl报错“Problem (2) in the Chunked-Encoded data”解决方案

    $s = curl_init(); curl_setopt($s, CURLOPT_POST, true); curl_setopt($s, CURLOPT_POSTFIELDS, $queryStr ...

  4. curl 报错记录,mark

    今天在做接口开发的时候,使用curl post ,请求返回数据为 null ,很纳闷,然后使用 curl_errno 打印出来的错误代码为 28 ,curl_error($ch) 打印出来的是Oper ...

  5. c++ 编译 curl 报错 数组‘__curl_rule_01__’的大小为负 解决方法

    背景:在原有的项目GCC编译环境下(arm-linux 32位),增加x86-linux 64位的编译环境,编译curl库的时候发生错误. 其他:编译服务器为64位Centos 编译错误提示 /inc ...

  6. windows下curl报错:curl : (1) Protocol https not supported or disabled in libcurl

    如果命令语句中有单引号,改为英文双引号试一下

  7. 【curl】【php】curl报错,错误代码77,CURLE_SSL_CACERT_BADFILE (77)解决方法

    CURLE_SSL_CACERT_BADFILE (77) - 读取 SSL CA 证书时遇到问题(可能是路径错误或访问权限问题) 在微信接口相关开发时容易出现此问题 这一般是因为服务更新了相关的软件 ...

  8. CURL命令报错:dyld: lazy symbol binding failed: Symbol not found: _SSL_load_error_strings解决办法

    Mac OS X 10.11.6, curl 命令报错,错误如下: dyld: lazy symbol binding failed: Symbol not found: _SSL_load_erro ...

  9. CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

    今天安装完带图形界面的CentOS 7后,在Terminal中运行yum安装命令时报了以下错误: Could not retrieve mirrorlist http://mirrorlist.cen ...

随机推荐

  1. ctime使用及datetime简单使用

    from time import ctime,sleep def Clock(func): def clock(): print("现在是:",ctime()) func() sl ...

  2. PHP current() 函数

    实例 输出数组中的当前元素的值: <?php$people = array("Peter", "Joe", "Glenn", &quo ...

  3. PHP substr_compare() 函数

    实例 比较两个字符串: <?php高佣联盟 www.cgewang.comecho substr_compare("Hello world","Hello worl ...

  4. luogu P4948 数列求和 推式子 简单数学推导 二项式 拉格朗日插值

    LINK:数列求和 每次遇到这种题目都不太会写.但是做法很简单. 终有一天我会成功的. 考虑类似等比数列求和的东西 帽子戏法一下. 设\(f(k)=\sum_{i=1}^ni^ka^i\) 考虑\(a ...

  5. Python 为什么会有个奇怪的“...”对象?

    本文出自"Python为什么"系列,请查看全部文章 在写上一篇<Python 为什么要有 pass 语句?>时,我想到一种特别的写法,很多人会把它当成 pass 语句的 ...

  6. PHP+Redis链表解决高并发下商品超卖问题

    目录 实现原理 实现步骤 上一篇文章聊了一下使用Redis事务来解决高并发商品超卖问题,今天我们来聊一下使用Redis链表来解决高并发商品超卖问题. 实现原理 使用redis链表来做,因为pop操作是 ...

  7. 自身写Android组合多个布局的经历

    今天不总结课程了,留着有时间补上. 今天的是ExpandListView,就是可以扩展的列表视图. 今天我做了个总结,然后模仿了扣扣的聊天界面,仅仅写了三个页面而已,用到的xml和活动就不下于10个, ...

  8. 12、Decorator 装饰器 模式 装饰起来美美哒 结构型设计模式

    1.Decorator模式 装饰模式又名包装(Wrapper)模式.装饰模式以对客户端透明的方式扩展对象的功能,是继承关系的一个替代方案. 装饰器模式(Decorator Pattern)允许向一个现 ...

  9. 微信公众平台上如何上传excel表格?

    微信公众平台上如何上传excel表格?   我们都知道创建一个微信公众号,在公众号中发布一些文章是非常简单的,但公众号添加附件下载的功能却被限制,如今可以使用小程序“微附件”进行在公众号中添加附件. ...

  10. BN系列-未完待续

    BN.LN.IN.GN Cross-Iteration Batch Normalization 因为有时候我们的计算能力有限,所以BN设置的比较小,这样BN效果就比较差. 因此我们将最近几次的batc ...