How to fix CertGetCertificateChain trust error CERT_TRUST_IS_UNTRUSTED_ROOT in R?

16.9k views Asked by At

I'm using R 3.5.2 version. And 1.4.0 version for httr package.

I calling an restApi Get:

CallingRestAPI = function(url){
  call.response <- GET(url = url, authenticate(username, password , type = "ntlm"))
  return(call.response)
}

Was working fine suddenly giving this error:

Error in curl::curl_fetch_memory(url, handle = handle) : 
  schannel: CertGetCertificateChain trust error CERT_TRUST_IS_UNTRUSTED_ROOT
2

There are 2 answers

1
Eli Berkow On

Update httr to the development version:

devtools::install_github('r-lib/httr')

or

remotes::install_github("r-lib/httr")

See:

0
Feetball On

Running this fixed it for me per this post:

httr::set_config(httr::config(ssl_verifypeer=0L))