Curl POST to HTTPS url gives SSLRead() error:curl: (56) SSLRead() return error -9806
当系统升级到OSX 10.10.3的时候,用brew更新软件安装包,出现了curl抛出的错误。
- ==> Upgrading boost
- ==> Downloading https://homebrew.bintray.com/bottles/boost-1.58.0.yosemite.bottle.tar.gz
- 0.7%
- curl: (56) SSLRead() return error -9806
- Error: Failed to download resource "boost"
起初,以为是宽带的问题,据说某宽带在使用过程中老是插入广告,竟连curl抓取数据包都难免植入广告。
如果是宽带的问题,应该说curl获取一切信息都会出错,经尝试,对于http协议的请求都是fine的,那么尝试https协议,发现github也是好的,可以收到数据。但是,一旦请求的https的具体的某一个包的时候,出现curl(56)错误:
- error:curl: (56) SSLRead() return error -9806
查询得知:curl(56)错误是----CURL_RECV_ERROR:Failure with receiving network data.
意思很明确了:curl接收网络数据失败。
最后的最后,只能从网上获取答案:很幸运,有人比我早遇到此类问题:
在stackoverflow上有篇名为《osx 10.10 Curl POST to HTTPS url gives SSLRead() error》
I just recently upgraded to OSX 10.10 Yosemite and I since the upgrade I can't do Curl POST to a SSL url anymore.
I first used wordpress' wp_remote_request call and also tried to use curl in php.Both (as expected) give the same error message:
Error Number:56Error String:SSLRead() return error -9806
Note: when I curl POST to HTTP it works fine.I reckon it is a setting in PHP.ini or in my apache (I lost my original HTTPD.conf file after upgrade...).
Can anyone help me out?
这是被采取的答案:
I've seen this error happen when php is compiled with a version of cURL that usesApple's Secure Transportunder Yosemite and the target of the URL request doesn't support SSLv3 (which was probably disabled due to thePOODLE vulnerability). What is the output of this command?
I suspect you'll see this:
You can overcome this by installing a version of php which uses a version of cURL which uses OpenSSL instead of SecureTransport. This is most easily done withhomebrew. So install that first if you don't already have it. If homebrew is installed but you haven't run Add the Homebrew taps below that you will need in order to get brewed php installed. Skip this step if these repos are already tapped. If you're unsure if these repos are already tapped, just run the commands below. Worst case scenario, you'll get a harmless
Then install curl with openssl:
Then install php using the curl you just installed and brewed openssl:
Install any php extensions you're going to need eg.
After you're done, run this again:
And you should see:
And now, re-test your application and the 大概意思: 先使用命令 php -i |grep "SSL Version" 看看SSL Version的信息,猜想你看到是:
有可能会出现不伤大雅的警告信息:
$ brew install --with-openssl curl
安装你需要的php的其他扩展,例如 :
完成后,再次运行下面的命令:
你会看到:
好吧,这个问题就这样解决了。 |
Curl POST to HTTPS url gives SSLRead() error:curl: (56) SSLRead() return error -9806相关推荐
- 使用Curl 访问 IPv6 的URL
正确命令 curl -g -d -k -v --interface [本机ipv6地址] https://[目标ipv6地址]:端口号/123.html 重点: ipv6 的 url 中 使用 &qu ...
- git 提交失败 HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
为什么80%的码农都做不了架构师?>>> 关于git提交失败报错POST git-receive-pack (chunked)或者HTTP 413 curl 22 The re ...
- git push error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403
这是远程链接错误,请求不到服务器 解决办法:找项目管理员帮你开push权限就可以了 参考链接: git push error: RPC failed; HTTP 403 curl 22 The req ...
- git push 失败,提示:error: RPC failed; HTTP 411 curl 22 The requested URL returned error: 411
1.场景描述 因为某些原因,在家里用自己电脑工作了三天,其中前端项目中有几个宣传页,所以引入很多图片,还有一些依赖.在最后想要将代码 push 到远程仓库时,出问题了.在git add 和git co ...
- git -- RPC failed; HTTP 403 curl 22 The requested URL returned error: 403
错误: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403 原因: 账户没有读写权限,联系管理索要权限 排查方法: 使 ...
- 使用curl工具调试https接口
工作中需要对接调试http接口,之前都是写代码测试,发现直接用curl这个工具更简单高效. 举例如下: 想要post一包数据给这个接口https://XXXXXXXXX http报文头规定如下: PO ...
- error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
在执行git clone 时 root@cdndev08:/media/share/webrtc-checkout# git clone https://chromium.googlesource.c ...
- 用curl自动登录HTTPS站点
前文http://blog.csdn.net/sheismylife/article/details/9237925演示了如何手动的通过运行curl命令登录HTTPS站点,然后获取cookie, 再拼 ...
- git error: RPC failed; curl 56 GnuTLS recv error 解决方案
git error: RPC failed; curl 56 GnuTLS recv error 解决方案 参考文章: (1)git error: RPC failed; curl 56 GnuTLS ...
最新文章
- 超越EfficientNet!MutualNet:一种自适应相互学习网络宽度和分辨率的网络
- 记录 之 遇到的 lamda 表达式和功能理解
- 设计模式19——行为型模式之备忘录模式
- Linux启动更新命令,Linux更新和查询命令chkconfig详细介绍
- 8g ubuntu 树莓派4b_树莓派4B安装 Ubuntu 20.04 LTS
- sublime配置python2和3_请教各位,关于sublime text3 配置python环境的两个小问题。
- location对象相关
- 【路径规划】基于matlab GUI粒子群算法机器人避障路径规划【含Matlab源码 923期】
- Linux文件误删除恢复操作
- python中num函数是什么意思_如何理解python3函数中num的用法?
- Android百度地图之定位图层
- COMSOL和Matlab联合仿真之复合材料填充建模
- how to search books in gitbook
- 数据库常用的sql语句名称大全
- 2021年中国玉米淀粉市场供需及价格分析,购销转淡,跌势趋稳,价格仍处高位「图」
- 给20块钱买可乐,每瓶可乐3块钱,喝完之后退瓶子可以换回1块钱,问最多可以喝到多少瓶可乐?
- 为什么size_t重要?为什么不直接用unigned long int 代替?以及size_t、ptrdiff_t、socklen_t数据类型
- 独立开发者如何笑傲江湖
- 为什么要学习 Netty?
- 管家婆SQL SERVER数据库修复案例