Error:: github :: Peer certificate cannot be authenticated with given CA certificates

Published by onesixx on

http://stackoverflow.com/questions/31293325/r-install-github-fails
https://www.r-bloggers.com/fixing-peer-certificate-cannot-be-authenticated/
https://stackoverflow.com/questions/48698532/r-server-install-packages-certificate-error

certificate 에러발생

> install.packages("tsbox")

> devtools::install_github("rstudio/tensorflow")
Error in curl::curl_fetch_disk(url, x$path, handle = handle) : 
  Peer certificate cannot be authenticated with given CA certificates

> remotes::install_github("ramnathv/slidify")
Error in curl::curl_fetch_disk(url, x$path, handle = handle) : 
  Peer certificate cannot be authenticated with given CA certificates

해결방법

way1

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

CURLOPT_SSL_VERIFYPEER 를 false로 설정한다. 
이 옵션은 curl이 peer의 certificate이 진짜임을 확인할지 말지를 결정한다. (1은 확인, 0은 확인안함)
http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html

관련 Option은 RCurl에 넘겨줄 필요가 있다.
In RCurl the CURLOPT_ is removed letters are lowercase and the underscore is changed to ..

–no-check-certificate

way2

http://blog.genoglobe.com/2019/04/r.html

회사내 ssl 정보를 받아서 R에게 알려줌.

$ vi ssl_cert.pem
$ git config --global http.sslCAInfo ./ssl_cert.pem
usethis::edit_r_environ()
# ./.Renviron
CURL_CA_BUNDLE='~/ssl_cert.pem'

Sys.getenv("CURL_CA_BUNDLE")

way3

욕심을 버리고, 서버에 들어가서 직접 다운받아 설치

$ curl -kO https://cran.r-project.org/src/contrib/tsbox_0.2.1.tar.gz
$ R CMD INSTALL tsbox_0.2.1.tar.gz

삽집1

setRepositories()          # change Repo
chooseCRANmirror()         # change Secure CRAN mirrors

Categories: R BasicR Etc&Tip

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x