问题
When I try to call install_github, I get the following error (not just for this package, but for all github packages):
> install_github('ramnathv/slidify')
Downloading github repo ramnathv/slidify@master
Error in curl::curl_fetch_memory(url, handle = handle) :
Problem with the SSL CA cert (path? access rights?)
But if I use RCurl directly to access github with ssl, I don't get any problem:
> x <- getBinaryURL(
url='https://github.com/ramnathv/slidify/archive/master.zip',
followlocation=1L
)
works with no errors, so RCurl can verify the SSL certificate properly and download the archive file.
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
locale:
[1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C
[3] LC_TIME=en_US.utf8 LC_COLLATE=en_US.utf8
[5] LC_MONETARY=en_US.utf8 LC_MESSAGES=en_US.utf8
[7] LC_PAPER=en_US.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RCurl_1.95-4.7 bitops_1.0-6 devtools_1.8.0
loaded via a namespace (and not attached):
[1] httr_1.0.0 R6_2.1.0 magrittr_1.5 rversions_1.0.2
[5] tools_3.2.1 curl_0.9.1 Rcpp_0.12.0 memoise_0.2.1
[9] xml2_0.1.1 stringi_0.5-5 git2r_0.10.1 stringr_1.0.0
[13] digest_0.6.8
And
> curlVersion()
$age
[1] 3
$version
[1] "7.38.0"
$vesion_num
[1] 468480
$host
[1] "x86_64-pc-linux-gnu"
$features
ipv6 ssl libz ntlm asynchdns spnego
1 4 8 16 128 256
largefile idn tlsauth_srp ntlm_wb
512 1024 16384 32768
$ssl_version
[1] "OpenSSL/1.0.1k"
$ssl_version_num
[1] 0
$libz_version
[1] "1.2.8"
$protocols
[1] "dict" "file" "ftp" "ftps" "gopher" "http" "https" "imap"
[9] "imaps" "ldap" "ldaps" "pop3" "pop3s" "rtmp" "rtsp" "scp"
[17] "sftp" "smtp" "smtps" "telnet" "tftp"
$ares
[1] ""
$ares_num
[1] 0
$libidn
[1] "1.29"
If I use httr::set_config( httr::config( ssl_verifypeer = 0L ) )
then I can successfully run install_github
but I would prefer to actually check ssl certificates.
Can anyone offer a solution?
回答1:
Finally figured this out.
I had two different ssl libraries installed and for some reason, the RCurl package built against libcurl4-openssl-dev and the curl package built against libcurl4-nss-dev, but I had only installed CA keys for openssl, not for nss.
I solved my problem with remove.packages('curl')
in R and then quitting R and from the shell apt-get remove libcurl4-nss-dev
starting R and install.packages('curl')
My mistake, which led to my question, was to test the SSL CA handling using RCurl
instead of httr
or curl
, which would have led me quickly to the fact that my curl
package was linked to the wrong SSL library.
回答2:
If httr
lib is missing the same error appears
try:
install.packages("httr")
回答3:
I removed httr
(deleting the whole httr folder directly from my R win-library) and reinstalled it. Then, installation from github worked smoothly
回答4:
When I use library swirl I met the same problem tooooo
After several try and find, I found that is because I haven't install openssl in R.
So:
install.packages("openssl")
then, everything ok!
Oh! I am using Windows 10, not Linux
回答5:
I was getting the same error with swirl while submitting assignments for Coursera. Uninstall and reinstall swirl itself, curl and htrr (which was also missing) did not address the issue. The only thing that actually worked was:
install.packages("openssl")
Also using Windows 10 and R 3.3.3.
回答6:
Make sure, the current version of R has the package curl
installed: install.packages('curl')
来源:https://stackoverflow.com/questions/31643036/devtoolsinstall-github-fails-with-ca-cert-error