r-忽略RCurl或curl中的弱DH



我在帖子中使用了下面的代码从url下载了一个CSV,但由于我的系统libcurl的最近更新,我的curl变得更加谨慎,并抱怨DH参数弱,在bash中,我可以使用--ciphers 'DEFAULT:!DH'选项忽略弱DH参数。我在httrcurlRCurl包中分别找不到GETfetch_memorygetURL函数的选项,它们的作用相同。

如何忽略R中的这些错误?(所有其他得到良好支持的库也可以工作,最好是tidyverse或r-opensci的东西(

raw_data <- read_delim(
"https://info.gesundheitsministerium.at/data/Epikurve.csv",
delim = ";",
col_types = cols(col_date(format="%d.%m.%Y"), col_integer(), col_datetime())
)

请注意,根据您的libcurl版本,您将无法复制这一点,旧版本似乎对弱DH参数更加宽容。我从事Debian测试。

由于curl命令行实用程序在我的平台上可用,我找到的最简单的解决方案就是使用它下载数据,并使用bash中的参数。

raw_data <- read_delim(
system2(
"curl",
args=c(
"https://info.gesundheitsministerium.at/data/Epikurve.csv",
"--ciphers",
"'DEFAULT:!DH'"
),
stdout=TRUE
),
delim = ";",
locale=locale(
encoding = "UTF-8",
date_format = "%d.%m.%Y",
tz = "CET"
)
)

最新更新