忽略 RCurl 或 curl 中的弱 DH

Ignore weak DH in RCurl or curl

我使用下面的代码从 post 中的 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"
    )
  )