Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R Peer certificate cannot be authenticated with given CA certificates, Windows

When trying to import a google sheet using the gs_read() function, I get the following error message:

Error in curl::curl_fetch_memory(url, handle = handle) : Peer certificate cannot be authenticated with given CA certificates

I am following this vignette and get the error when using the code:

oceania <- gap %>%  gs_read(ws = "Oceania")

I have found similar issues for Ubuntu and php, but nothing that has been able to help me.

Does anyone know why I am getting this error and how to fix it?

I am using R 3.3.2 and Windows 7.

like image 601
Malan Kriel Avatar asked Nov 03 '16 09:11

Malan Kriel


1 Answers

My colleague had the same issue and I stumbled on this post on R-Bloggers by Andrew Collier. The solution below will fix your problem, but I don't know if it might cause other security issues.

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

update: This will disable ssl verification. https://github.com/r-lib/httr/issues/262

like image 130
KERO Avatar answered Nov 01 '22 18:11

KERO