0

I'm hitting an SSL error in a ubuntu session of GitHub actions that I'm not sure I understand. these are the three lines of R code in the GitHub action that works on windows and macOS but fail on Ubuntu:

tf <- tempfile()
this_url <- "https://webfs.oecd.org/piaac/puf-data/SAS/SAS7BDAT/prgusap1_2012.sas7bdat"
download.file( this_url , tf , mode = 'wb' )

You can see the windows/macOS successes and ubuntu failures at: https://github.com/asdfree/piaac/actions/runs/4130891484

From what I've found elsewhere, it looks like I need to use OpenSSL on the Linux runner of the GitHub Actions.

I found some examples of how to use OpenSSL within an r.yml file here: https://github.com/jeroen/testbug/blob/929151a0f19ed029d0ae34a7b3661d453974de53/.github/workflows/test.yaml

But my attempt to modify the r.yml file didn't seem to solve the issue: https://github.com/asdfree/piaac/commit/9eb93f8ac8c2eae61300364337b6a357ba56d9e7

i've also attempted three alternatives to download.file() -- ubuntu still fails where windows and macOS succeeds. the error here shows up as unsafe legacy renegotiation disabled even when i use ssl.verifypeer=FALSE

https://github.com/asdfree/piaac/commit/07cb4808a4d027f28d6e8cefdf5af09493dcb309 https://github.com/asdfree/piaac/actions/runs/4131647361

https://github.com/asdfree/piaac/commit/468588f6813cfe734d7b11b875070b331189cbc0 https://github.com/asdfree/piaac/actions/runs/4131695976

https://github.com/asdfree/piaac/commit/77e228ef72fc3a781dba51c23ceb9f54f0fac286 https://github.com/asdfree/piaac/actions/runs/4131784227

Any advice about how to work around this issue would be appreciated. Thanks!

Anthony Damico
  • 5,779
  • 7
  • 46
  • 77
  • Does this answer your question? [Download a file from HTTPS using download.file()](https://stackoverflow.com/questions/23028760/download-a-file-from-https-using-download-file) – Azeem Feb 09 '23 at 05:17
  • @Azeem thank you! i've tried a few alternatives listed on that SO post without success -- i've edited my question to mention those as well – Anthony Damico Feb 09 '23 at 07:10
  • Right. That's strange. All those tries are failing with `error:0A000152:SSL routines::unsafe legacy renegotiation disabled`. – Azeem Feb 09 '23 at 07:27
  • Alternatively, you can try to directly download it using `wget` command and [`system()`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/system.html) function e.g. `system(paste('wget ', this_url, ' -O ', tf))`. – Azeem Feb 09 '23 at 07:36
  • But, there's a caveat that it won't run generically for all those platforms. Anyway, let's see if this work for Linux or not. – Azeem Feb 09 '23 at 07:40
  • For `error:0A000152:SSL routines::unsafe legacy renegotiation disabled`, here's the relevant `curl` GitHub issue (https://github.com/curl/curl/issues/9158). – Azeem Feb 09 '23 at 07:44
  • Without downgrading the library version or resorting to some other similar workaround, the quick possible solutions (for all the platforms) seem to be 1) to add a separate step to download the file, and 2) if the file is not dynamic you can simply download and push it to your test directory to be used later in the tests. – Azeem Feb 09 '23 at 07:53

0 Answers0