问题描述
我试图让 devtools :: install_github()
在Windows 7上的公司代理后面工作。
I'm trying to get devtools::install_github()
working behind my corporate proxy on Windows 7.
到目前为止,我必须执行以下操作:
So far I've had to do the following:
> library(httr)
> library(devtools)
> set_config(use_proxy("123.123.123.123",8080))
> devtools::install_github("rstudio/ggvis")
Installing github repo ggvis/master from rstudio
Downloading master.zip from https://github.com/rstudio/ggvis/archive/master.zip
Error in function (type, msg, asError = TRUE) :
SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
显然我们有某种证书服务器用我们自己的公司SSL证书替换SSL证书(通过转到确认,检查证书)。
Apparently we have some kind of certificate server replacing SSL certs with our own corporate SSL certs (confirmed by going to https://github.com and examining the cert).
反正只是想知道是否有一种方法可以忽略该证书错误并继续进行安装?
Anyhow, just wondering if there's a way to ignore that cert error and proceed with the installation?
推荐答案
处理该问题的一种方法是将 CURLOPT_SSL_VERIFYPEER
设置为false。此选项确定curl是否验证对等方证书的真实性。值为1表示卷曲验证; 0(零)表示没有。
One way to handle the problem is to set the CURLOPT_SSL_VERIFYPEER
to false. This option determines whether curl verifies the authenticity of the peer's certificate. A value of 1 means curl verifies; 0 (zero) means it doesn't.http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html
相关选项需要传递给 RCurl
。在 RCurl
中,将 CURLOPT _
删除,但字母均小写,并且下划线更改为。
。
The relevant option needs to be passed to RCurl
. In RCurl
the CURLOPT_
is removed letters arre lowercase and the underscore is changed to .
.
set_config( config( ssl.verifypeer = 0L ) )
将在使用 httr
时将相关选项传递给 RCurl
。
will pass the relevant option to RCurl
when using httr
.
更新:
httr
答案写成已经从RCurl移到 curl
包中了。 cURL选项现在用下划线指定
,因此上面是:
The httr
since this answer was written has moved from RCurl as an underlying dependence to the curl
package. cURL options are now specifiedwith underscores so the above would be:
set_config( config( ssl_verifypeer = 0L ) )
当前版本的 httr
。
这篇关于devtools :: install_github()-忽略SSL证书验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!