harrelfe/Hmisc

Trouble accessing datasets with `getHdata`

thomasgstewart opened this issue · 2 comments

Several of my students have reported the following error when trying to access datasets with getHdata.

Hmisc::getHdata(nhgh) #loads nhgh, the NHANES data
Error in file(file, “r”) :
  cannot open the connection to ‘https://hbiostat.org/data/repo/Rcontents.txt’
In addition: Warning message:
In file(file, “r”) :
  URL ‘https://hbiostat.org/data/repo/Rcontents.txt’: status was ‘SSL peer certificate or SSH remote key was not OK’

While relevant to Hmisc, I think this is either a problem with the users' system or the hbiostat server's generated certificate. This R code should fail on affected computers (basically what Hmisc uses):

file <- url('https://hbiostat.org/data/repo/Rcontents.txt')
ads <- scan(file, list(''), quiet=TRUE)[[1]]

The url function uses one of two methods to connect to a web site, either wininet (windows) or libcurl (unix). I'm not sure how to test wininet, but users could try a couple of things to test curl.
From a terminal (not R), try these commands:

curl -v https://hbiostat.org/data/repo/Rcontents.txt
curl -v --insecure https://hbiostat.org/data/repo/Rcontents.txt

Do both/neither/second-line work? I don't really have a fix for either case but I think this would at least tell us more information about how this is failing. My ultimate guess is that something is misconfigured on the hbiostat server.

I'll note that all of the above work for me on my Linux system.