2010-08-09 5 views
1

오늘 제가 좋아하는 R 패키지 중 하나를 사용하여 Google 스프레드 시트의 데이터를 읽었습니다. 그것은 작동하지 않을 것이다. 이 문제는 모든 컴퓨터에서 발생합니다 (창을 사용함) 새로운 문제인 것으로 보입니다. 나는 RGoogleDocs의 0.4-1 버전을 사용 중이다.SSL 인증서 문제를 일으키는 RGoogleDocs (또는 RCurl)

library(RGoogleDocs) 
ps <-readline(prompt="get the password in ") 
sheets.con = getGoogleDocsConnection(getGoogleAuth("[email protected]", ps, service ="wise")) 
ts2=getWorksheets("OnCall",sheets.con) 

그리고 마지막 줄을 실행 한 결과이다.

Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

나는 약간의 독서를했고 흥미로 우며 적어도 나에게는 유용하지 않은 정보를 접하게되었습니다. Curl: SSL certificate problem, verify that the CA cert is OK

When I try to interact with a URL via https, I get an error of the form

나는 아주 큰 그림 메시지를 가지고하지만 내 스크립트의 솔루션을 구현하는 방법을 알고하지 않았다. getWorksheets 전에 다음 행을 삭제했습니다. 작동하지 않았다
x = getURLContent("https://www.google.com", ssl.verifypeer = FALSE) 

그래서 나는 또한 작동하지 않았다
ts2=getWorksheets("OnCall",sheets.con,ssl.verifypeer = FALSE) 

을 시도했다.

흥미롭게도, 다음 줄은

getDocs(sheets.con,folders = FALSE) 

당신이 내가 다시 작동하려고 무엇을 제안 할 작동? 감사.

+0

여기에 구원이 있습니까? 나는 같은 문제를 겪었다 ... –

+0

더 이상 문제가 없습니다. 나는 아래에 나를 위해 일하는 것을 게시했다. 그것이 당신을 위해 어떻게되는지 말해주세요. – Farrel

답변

0

아마도 certificate bundle이 설치되어 있지 않을 수 있습니다. OS X에 설치했습니다. curl 사이트에서도 찾을 수 있습니다.

+0

답변 해 주셔서 감사합니다. 나는 RCurl이 인증서 번들을 설치했을 것으로 의심했다. 그래서 나는 cacert.pem에 대한 하드 드라이브를 검색했다. 그곳에는 C : \ Program Files (x86) \ R \ R-2.11.1 \ library \ RCurl \ CurlSSL \ cacert.pem 그것? – Farrel

3

더 이상이 문제가 없습니다. 나는 내가 문제를 극복하고 누가 나를 도왔는지 기억하지 못하는 정확한 일정을 기억하지 못한다. 그러나 여기에 전형적인 세션이있다.

library(RGoogleDocs) 
if(exists("ps")) print("got password, keep going") else ps <-readline(prompt="get the password in ") #conditional password asking 
options(RCurlOptions = list(capath = system.file("CurlSSL", "cacert.pem", package = "RCurl"), ssl.verifypeer = FALSE)) 
sheets.con = getGoogleDocsConnection(getGoogleAuth("[email protected]", ps, service ="wise")) 
#WARNING: this would prevent curl from detecting a 'man in the middle' attack 
ts2=getWorksheets("name of workbook here",sheets.con) 
names(ts2) 
sheet.1 <-sheetAsMatrix(ts2$"Sheet 1",header=TRUE, as.data.frame=TRUE, trim=TRUE) #Get one sheet 
other <-sheetAsMatrix(ts2$"whatever name of tab",header=TRUE, as.data.frame=TRUE, trim=TRUE) #Get other sheet 

도움이 되셨습니까?

+0

은 매력처럼 작동합니다. 중요한 라인은 내가 알아 낸 RCurlOptions입니다. Thx 솔루션! –

+0

예 x10000 - R에서 dropbox에 연결하는 동안 찾으려면 몇 시간이 걸렸습니다. – JayCo