ETA: Per https://github.com/hiratake55/RForcecom/issues/42 , it looks like the author of the rforcecom package has updated rforcecom to use httr instead of RCurl (as of today, to be uploaded to CRAN tomorrow, 7/1/16), so my particular issue will be solved at that point. However, the general case (implementing TLS 1.1/1.2 in RCurl) may still be worth pursuing for other packages. Or everyone may just switch to the more recent curl package instead of RCurl.RCurl中的TLS v1.1/TLS v1.2支持
背景:我一直在使用rforcecom软件包与Salesforce进行数月的交流。 Salesforce最近禁用了对TLS v1.0的支持,并且在其Sandbox中需要TLS v1.1或更高版本;此更新将于2017年3月在生产环境中进行。
rforcecom使用RCurl与salesforce.com服务器进行通信。一般使用curlPerform方法,它是实现这样的事情(本例中为rforcecom.login.R):
h <- basicHeaderGatherer()
t <- basicTextGatherer()
URL <- paste(loginURL, rforcecom.api.getSoapEndpoint(apiVersion), sep="")
httpHeader <- c("SOAPAction"="login","Content-Type"="text/xml")
curlPerform(url=URL, httpheader=httpHeader, postfields=soapBody, headerfunction = h$update, writefunction = t$update, ssl.verifypeer=F)
这已经为我工作了一段时间,正如我所说。现在,Salesforce的已禁用TLS V1.0上沙箱,但是,它失败,出现以下错误:
UNSUPPORTED_CLIENT: TLS 1.0 has been disabled in this organization. Please use TLS 1.1 or higher when connecting to Salesforce using https.
我修改和采购(不包中的本地副本实现它,因为我没有经验足够做到这一点)对RForcecom的登录模块的本地副本进行了更改,并且我通过实验发现,我可以通过将sslversion=SSLVERSION_TLSv1
,sslversion=SSLVERSION_SSLv3
等添加到SSLVERSION中来成功指定SSLVERSION的任何现有枚举值curlPerform选项被调用。但是,所有这些都给了我与上面相同的错误。当我尝试使用的是libcurl中实现,但不是在RCurl(SSLVERSION_TLSv1.1
,SSLVERSION_TLSv1.2
)的选项之一,我得到以下错误:
Error in merge(list(...), .opts) : object 'SSLVERSION_TLSv1.1' not found
或:
Error in merge(list(...), .opts) : object 'SSLVERSION_TLSv1.2' not found
我已经验证与curlVersion()
我的libcurl版本是7.40.0,根据https://curl.haxx.se/libcurl/c/CURLOPT_SSLVERSION.html确实支持这些选项。但是,我无法让RCurl识别它们。
在这一点上,我正在寻找的是一种让RCurl使用TLS v1.1或TLS v1.2的方法,我非常感谢能够得到的任何帮助。对于我的问题中的任何问题/问题,我深表歉意,因为这是我第一次自问,以前我总是能够通过阅读其他人的问题和答案来解决问题。