问题描述
当我尝试调用install_github时,出现以下错误(不仅针对此软件包,而且针对所有github软件包):
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?)
但是如果我直接使用RCurl使用ssl访问github,我不会遇到任何问题:
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
)
正常工作,因此RCurl可以正确验证SSL证书并下载存档文件。
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
和
> 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"
如果我使用 httr :: set_config(httr :: config(ssl_verifypee r = 0L))
,那么我可以成功运行 install_github
,但我希望实际检查ssl证书。
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?
推荐答案
最后弄清楚了
我安装了两个不同的ssl库,由于某种原因,针对libcurl4-openssl-dev构建的RCurl软件包和针对libcurl4-nss-dev构建的curl软件包,但是我只为openssl而不是nss安装了CA密钥。
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.
我用 remove.packages('curl')解决了我的问题R中的code>然后退出R,然后从外壳
apt-get删除libcurl4-nss-dev
开始R和 install.packages( 'curl')
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')
我的错误导致了我的问题,那就是使用
RCurl测试SSL CA处理
而不是 httr
或 curl
,这会使我很快意识到 curl
软件包链接到错误的SSL库。
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.
这篇关于devtools :: install_github失败,并显示CA证书错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!