Hon*_*Ooi 2 r libcurl ssl-certificate
有没有办法在默认情况下禁用 SSL 验证download.file?
情况是我们公司有一个内部 CRAN 镜像,但它使用自签名 SSL 证书。据我所知,这会导致download.file失败,并且由于install.packages使用了download.file,这意味着安装软件包也会失败。我想关闭验证检查以查看是否可以解决问题。
操作系统是Ubuntu 20.04(实际上在容器内运行),R是4.1.1。
download.file通过将下载方法设置为curl并指定适当的标志,可以忽略SSL 问题:
# -k means don't verify cert, -L means follow redirects (important for some servers)
options(download.file.method="curl", download.file.extra="-k -L")
download.file("https://internal.server/file", "destfile")
Run Code Online (Sandbox Code Playgroud)
但是,这需要安装curl命令行工具。我使用的 Docker 镜像并非如此,但这是另一个问题。