httr icon indicating copy to clipboard operation
httr copied to clipboard

SSL issue?

Open eujinn opened this issue 3 years ago • 3 comments

I am trying to make a simple GET call in R and I am getting the following error. From the API documentation it says that I need to disable the ssl verification. Error in curl::curl_fetch_memory(url, handle = handle) : timed out before SSL handshake

Tested with the following and the issue still persist. library(httr) set_config(config(use_ssl=0L, ssl_verifypeer=0L, ssl_verifyhost=0L, sslversion=3))

Please advise.

eujinn avatar Aug 07 '20 17:08 eujinn

I suspect you may be better off opening this in the curl repo:

https://github.com/jeroen/curl/issues

jennybc avatar Aug 07 '20 20:08 jennybc

But I am calling it with httr. Any suggestion on how can I disable SSL?

eujinn avatar Aug 08 '20 12:08 eujinn

There's a really nice investigation into this issue in https://github.com/Ensembl/ensembl-rest/issues/427#issue-614497457

As far as getting a working solution in using httr this worked for me:

library(httr)
url <- "https://rest.ensembl.org/"

## This fails
res <- GET(url)
#> Error in curl::curl_fetch_memory(url, handle = handle): error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

## lower the security level
httr_config <- config(ssl_cipher_list = "DEFAULT@SECLEVEL=1")
res <- with_config(config = httr_config, GET(url))
res
#> Response [https://rest.ensembl.org/]
#>   Date: 2020-10-01 10:32
#>   Status: 200
#>   Content-Type: text/html; charset=utf-8
#>   Size: 31.5 kB
#> 
#> 
#> <!DOCTYPE html>
#> 
#> 
#> 
#> <html lang="en">
#> <head>
#>         <script src="/static/js/20-prettify.js"></script>
#>         <script src="/static/js/30-jquery-1.11.1.min.js"></script>
#> ...

grimbough avatar Oct 02 '20 13:10 grimbough