7

I have been using getURL from curl (in R) to read from https://fantasy.premierleague.com/drf/bootstrap-static

Example code: print(getURL("https://fantasy.premierleague.com/drf/bootstrap-static"))

No problem until a few days ago. But now getting the error:

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

Have upgraded to latest R (3.4.0) and curl package: RCurl_1.95-4.8

I have a workaround (to use GET from httr) but can anyone help me get it working with getURL?

I believe the server change is that they only now support TLS 1.2. I have tried the following to fix but now get a new error. May relate to needing newer OpenSSL?

CURL_SSLVERSION_TLSv1_2 <- 6L
opt <- RCurl::curlOptions(verbose = TRUE, sslversion = 
CURL_SSLVERSION_TLSv1_2)
print( RCurl::getURL("https://fantasy.premierleague.com/drf/bootstrap-static", .opts = opt))

New error is:

Unsupported SSL protocol version
M--
  • 25,431
  • 8
  • 61
  • 93
mikecro
  • 101
  • 1
  • 1
  • 6
  • 1
    I am reasonably sure that Rcurl needs to be rebuilt with OpenSSL 1.0.1 to support TLS 1.2. I have reported it as a bug. Meanwhile httr functions seem OK. – mikecro May 19 '17 at 07:36

1 Answers1

4

I think if you remove the getURL part of the code it should work ok

url = "https://fantasy.premierleague.com/drf/bootstrap-static"
json = fromJSON((url))
user1966593
  • 69
  • 10