OS X El Capitan -9806上的RCurl错误 [英] RCurl on OS X El Capitan -9806 Error
问题描述
我正在尝试使用RCurl进行oauth 2身份验证.我的代码是:
I am trying to use RCurl for an oauth 2 authentication. My code is:
library(RCurl)
myOpts <- curlOptions(httpheader =
c(Accept="application/json",
"Content-Type"="application/x-www-form-urlencoded"))
token <- postForm(authURL,
.params = list(
client_id ="aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
client_secret = "bbbbbbbbbbbbbbbbbbbbbbbbbbbb",
username = "xxxxx@yyyy.zzz",
password = pswd),
.opts = myOpts,
style="POST")
该代码在R/Windows上可以正常运行,但在OS X El Capitan上不能正常运行.在OS X上,出现错误
The code works just fine on R/Windows, but not on OS X El Capitan. On OS X, I get the error
Error in function (type, msg, asError = TRUE) :
SSLRead() return error -9806
我认为OS X附带的curl/libcurl版本的SSL出现了问题,并且在其他地方对此进行了介绍,但是我还没有找到解决办法.对于它的价值,我在httr软件包中也遇到了类似的问题.如何更新curl并使其在RCurl中很好地播放?
I think it is a problem with SSL in the version of curl/libcurl that ships with OS X, and is documented elsewhere, but I haven't been able to figure out a fix. For what it's worth, I had similar problems with the httr package. How do I update curl and make it play nicely with RCurl?
My question is quite similar to How do I get RCurl to connect to POST SSL on OS X Yosemite?, but El Capitan has made it difficult to copy the curl-config file as suggested in the answer to that post.
推荐答案
我完成了以下工作:
- 按照通常的gnu configure/make/install顺序从源代码安装libressl.
- 使用通常的gnu configure/make/install顺序再次从源安装curl.在配置步骤中,我需要使用--with-ca-bundle选项将配置指向有效的证书文件.
- 从源代码编译RCurl,确保/usr/local/bin在路径列表中早于/usr/bin,以便RCurl的configure脚本从新版本的curl中而不是从os x默认版本中找到curl-config.
我很想知道是否有更好的方法.
I'd love to know if there's a better way.
这篇关于OS X El Capitan -9806上的RCurl错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!