8

I tried the following code in R on windows:

library(RCurl)
postForm("https://www.google.com/accounts/ClientLogin/",
    "email" = "[email protected]",
    "Passwd" = "abcd",
    "service" = "finance",
    "source" = "Test-1"
)

but go the following error:

Error in postForm()
SL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

How do I setup RCurl to allow use of HTTPs?

1
  • 1
    More of a guess than an answer, but does curlVersion()$protocol include "https"? If not, then you need to install a version of the curl library with ssl support. How to do that would depend on your operating system (the output of sessionInfo() might help) Commented Jul 18, 2011 at 23:36

2 Answers 2

13

just add .opts = list(ssl.verifypeer = FALSE) to your query

postForm("https://www.google.com/accounts/ClientLogin/",
    "email" = "[email protected]",
    "Passwd" = "abcd",
    "service" = "finance",
    "source" = "Test-1",
    .opts = list(ssl.verifypeer = FALSE))
Sign up to request clarification or add additional context in comments.

1 Comment

This answer is dangerously incorrect. You should not disable verification that the connection is valid without fully understanding the implications of that decision.
12

You need to install a SSL library.

  1. For windows you can get one here: Download "OpenSSL for Windows" version 0.9.8k

  2. Unzip to a temporary folder, and copy the files "libeay32.dll" and "ssleay32.dll" from the "bin" sub-folder to R\library\RCurl\lib\i386.

  3. Also you might copy it into the same directory as the R.exe.

  4. Then check if you have access to the https protocol:

    library(RCurl)
    curlVersion()$protocol 
    ## [1] "tftp"   "ftp"    "telnet" "dict"   "ldap"   "http"   "file"   "https"     
    ## [9] "ftps"   "scp"    "sftp"  
    
  5. Then install a new set of credential files:

    ca-bundle.crt can be found at : http://curl.haxx.se/ca/cacert.pem

    rename / copy to ca-bundle.crt

  6. Test with this:

    getURL("https://www.google.com/accounts/ClientLogin/?service=finance&[email protected]&Passwd=abcd&source=Test-1", 
           cainfo = "path to R/library/RCurl/CurlSSL/ca-bundle.crt")
    

1 Comment

@Mscha Vreeburg, I followed your steps, I get this error: Error in function (type, msg, asError = TRUE) : error setting certificate verify locations: CAfile: C:/Users/Documents/R/win-library/3.2/RCurl/CurlSSL/ca-bundle.crt CApath: none

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.