簡體   English   中英

R - 更改站點后使用 curl 中的 getURL 時出錯

[英]R - Error when using getURL from curl after site was changed

我一直在使用 curl(在 R 中)的 getURL 從https://fantasy.premierleague.com/drf/bootstrap-static讀取

示例代碼: print(getURL("https://fantasy.premierleague.com/drf/bootstrap-static"))

直到幾天前都沒有問題。 但現在得到錯誤:

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

已升級到最新的 R (3.4.0) 和 curl 包:RCurl_1.95-4.8

我有一個解決方法(從 httr 使用 GET),但誰能幫我讓它與 getURL 一起工作?

我相信服務器的變化是他們現在只支持 TLS 1.2。 我嘗試了以下修復,但現在出現新錯誤。 可能與需要更新的 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))

新錯誤是:

 Unsupported SSL protocol version

我認為如果您刪除代碼的getURL部分,它應該可以正常工作

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM