greg42627
greg42627

Reputation: 79

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

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.

Upvotes: 2

Views: 2389

Answers (2)

Peter
Peter

Reputation: 363

For me the solution was to set global settings via

httr::set_config(config(ssl_verifypeer = FALSE, ssl_verifyhost = FALSE))

Upvotes: 2

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.

Upvotes: 1

Related Questions