我知道類似的問題已被再次詢問。不過,我嘗試了我在這裏和谷歌上找到的所有東西,而且似乎沒有任何東西可以用於我。R證書中的twitteR SSL證書失敗
我的代碼如下:
reqURL <- "http://api.twitter.com/oauth/request_token"
accessURL <- "http://api.twitter.com/oauth/access_token"
authURL <- "http://api.twitter.com/oauth/authorize"
consumerKey <- "xxxxxxxxxxx"
consumerSecret <- "xxxxxxxxxxxxxxxxxxx"
twitCred <- OAuthFactory$new(consumerKey=consumerKey,
consumerSecret=consumerSecret,
requestURL=reqURL,
accessURL=accessURL,
authURL=authURL)
twitCred$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))
registerTwitterOAuth(twitCred)
在這裏,我得到: [1] TRUE
但如果我試試這個: tweets = searchTwitter('blabla', n=1500)
我收到以下錯誤: [1] "SSL certificate problem, verify that the CA cert is OK. Details:\nerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed" Error in twInterfaceObj$doAPICall(cmd, params, "GET", ...) : Error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
這裏是包和版本插件在我的電腦:
sessionInfo() R version 2.15.1 (2012-06-22) Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=Greek_Greece.1253 LC_CTYPE=Greek_Greece.1253
[3] LC_MONETARY=Greek_Greece.1253 LC_NUMERIC=C
[5] LC_TIME=Greek_Greece.1253
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ROAuth_0.9.2 digest_0.6.2 twitteR_1.1.0 rjson_0.2.12
[5] RCurl_1.95-4.1 bitops_1.0-5
loaded via a namespace (and not attached):
[1] tools_2.15.1
任何幫助將是非常有用的!
可能重複:http://stackoverflow.com/q/9916283/1036500(我不能讓它工作,要麼...) – Ben 2013-03-11 20:04:11
我想補充一點偏執的:不是每一個SSL證書失敗是一種編程錯誤,其中一些是實際的攻擊(即您的僱主,政府或其他第三方替換無效證書)。 Twitter是否可以在Google Chrome中爲您工作? – themel 2013-03-19 05:39:38
是的,爲什麼不呢? – Stergios 2013-03-19 17:15:42