How do I resolve this RCurl error: "SSL certificate problem: certificate has expired"?

Viewed 1635

I'm just trying to get a simple URL response below and I get the following error. The website is valid and I've been able to pull from it thousands of times in the past.

jsonString <- getURL(full_url)

Error in function (type, msg, asError = TRUE)  : 
  SSL certificate problem: certificate has expired

Any ideas? I am running R 4.0.0 (I upgraded to see if that would fix the issue) and have the most up to date RCurl package.

1 Answers

I have been facing the same problem from the past few weeks. So if you are using Rstudio and Rcurl package and getting the "Error in function (type, msg, asError = TRUE) : SSL certificate problem: certificate has expired" error, try the below code.

RCurl_raw <- RCurl::postForm(
    uri = redcap_uri
    , token = token
    , content = 'record'
    , format = 'csv'
    , type = 'flat'
    , rawOrLabel = 'raw'
    , exportDataAccessGroups = 'true'
    , .opts = RCurl::curlOptions(ssl.verifypeer=FALSE, verbose=TRUE)
)

ssl.verifypeer should be false.

Related