1

I am trying to download COVID data in R from a Github site, but I am getting a protocol version error. This function has worked fine for many months, but now it stopped working. Can anybody tell me why it is not working? I can't seem to find any documentation of a solution how to make getURL work.

file <- getURL("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/01-14-2021.csv")

gives the following error :

Error in function (type, msg, asError = TRUE)  : 
  error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

Besides, curlVersion() doesn't match the expected openssl version installed at the OS level : when I run the command RCurl::curlVersion()$ssl_version, I get "OpenSSL/1.0.0o" I don't know how to update this to version 1.1.1g.

Context :

  • 64bit PC Windows 10
  • R version 4.0.3
  • RCurl package version 1.98.1.2
  • openssl version 1.1.1g 21 Apr 2020 .

Thanks.

Eugène Adell
  • 3,089
  • 2
  • 18
  • 34
BenW
  • 101
  • 12
  • Does this answer your question? [R - Error when using getURL from curl after site was changed](https://stackoverflow.com/questions/43843204/r-error-when-using-geturl-from-curl-after-site-was-changed) – Eugène Adell Jan 16 '21 at 12:08
  • I looked at that post, but I don't see how that answers my question. That post is from 2017 and it doesn't have an accepted answer. getURL was working perfectly up until a week ago and I have all the latest versions of R and Rcurl. The post just recommends using a different function, but it doesn't explain why getURL is not working as of this week. – BenW Jan 16 '21 at 20:43
  • Your problem might be that the website has changed its SSL config (as in the question I mentioned), and that you would need to rebuild RCURL with the latest openssl (as said in a comment). The website only [accepts TLS1.2/1.3](https://www.ssllabs.com/ssltest/analyze.html?d=raw.githubusercontent.com&s=151.101.0.133&latest). You can add `openssl version` to your question and your exact versions of R/cURL. Right answers aren't always accepted, and users also often forget to answer their own question once they know what's wrong. It's a pity – Eugène Adell Jan 17 '21 at 09:14
  • Thanks. I added the version info to my question. I'm looking for a solution how to fix getURL. I reloaded the RCurl package, but it doesn't help. – BenW Jan 17 '21 at 17:56
  • Which is your openssl version (`openssl version` command) ? – Eugène Adell Jan 17 '21 at 20:00
  • openssl version 1.1.1g 21 Apr 2020. I'm not sure how to go about rebuilding rCurl to a later openssl version. – BenW Jan 18 '21 at 03:42
  • Sorry for asking, but please provide more information on your system. If you are on Linux : `uname -a` and `cat /etc/*release*` . We'll then see if I start a bounty, it's not obvious to reproduce this problem. – Eugène Adell Jan 18 '21 at 23:28
  • My computer is a 64bit PC Windows 10. Are you saying that you don't get the same error if you run that code I put in the post? – BenW Jan 20 '21 at 15:06
  • Indeed, I don't get the same error and I am probably using a very different install method for installing this software (on a Linux). – Eugène Adell Jan 20 '21 at 20:14

2 Answers2

0

Yet another broken R package, poorly documented, not maintained, doesn't taking any constructive feedback and so on. Unfortunately there are similar questions without real answers other than suggesting to try another (better) package like httr .I can't give a better one.

Old SSL servers accepting TLS 1.0 would work for example :

getURL("https://www.ietf.org", sslversion=4L)

But your website only allows TLS 1.2 & 1.3, and trying TLS 1.2 gives an unsupported error on the client side, whatever site we try

getURL("https://www.ietf.org", sslversion=5L)
Error in function (type, msg, asError = TRUE)  : 
  Unsupported SSL protocol version
Eugène Adell
  • 3,089
  • 2
  • 18
  • 34
-1

I have the exactely same problem, with curlversion 1.98-1.2 SSL version "OpenSSL/1.0.0o" ; R version 4.0.2 ; Windows10 ;

  • ```file <- read.csv("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/01-14-2021.csv")``` – jean gaudart Jan 19 '21 at 16:53
  • it's better to edit your own Answer than posting this comment. Moreover, consider voting on the question if you are facing the very same issue. – Eugène Adell Jan 20 '21 at 20:25