错误:无法从私有SVN服务器安装R软件包

时间:2018-09-25 19:15:37

标签: r curl ssl-certificate visualsvn-server r-package

在Windows 10计算机(x64)上,我尝试使用here给出的说明从私有SVN服务器(Visual SVN服务器)安装R软件包(在R Studio内部)。服务器具有一个自签名证书。要安装该软件包,我正在运行以下命令:

install.packages("https://~path_to_private_SVN/trunk", repos = NULL, type = "source", method="curl", extra = "--user my_username:my_password")

我收到此错误消息:

 Installing package into ‘path_to_R_library/3.5’
    (as ‘lib’ is unspecified)
    % Total    % Received % Xferd  Average Speed   Time    Time     Time Current
                                 Dload  Upload   Total   Spent    Left  Speed
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
HTTPS-proxy has similar options --proxy-cacert and --proxy-insecure.
Error in download.file(p, destfile, method, mode = "wb", ...) : 
  'curl' call had nonzero exit status

很显然,R Studio对SVN服务器证书问题不满意,并且我无法安装R软件包。但是,目前,我想忽略SVN服务器的此证书错误问题。有没有办法告诉install.packages()对此SVN主机不执行SSL certificate verification?我知道安装R软件包的另一种选择可能是devtools::install_svn()

1 个答案:

答案 0 :(得分:0)

服务器的证书有问题,并且不受信任。您问题中的错误消息指定了解决步骤和解决方法。例如,您可以在curl中禁用证书验证:

如果您要关闭curl对证书的验证,请使用 -k(或--insecure)选项。

有关在服务器上设置服务器证书的信息,请参见KB134: Configuring SSL Certificates for VisualSVN Server