curl icon indicating copy to clipboard operation
curl copied to clipboard

Unsupported proxy 'https://proxy.dom.com/', libcurl is built without the HTTPS-proxy support

Open mallick84 opened this issue 6 years ago • 9 comments

I install curl from GitHub in a fresh r session

install.packages("https://github.com/jeroen/curl/archive/master.tar.gz", repos = NULL)

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252    LC_MONETARY=English_India.1252
[4] LC_NUMERIC=C                   LC_TIME=English_India.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_2.1.0 usethis_1.5.1  httr_1.4.1     curl_4.0.9000 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1        lattice_0.20-38   tidyr_0.8.3       binman_0.1.1      prettyunits_1.0.2
 [6] ps_1.3.0          assertthat_0.2.1  zeallot_0.1.0     rprojroot_1.3-2   digest_0.6.20    
[11] mime_0.7          R6_2.4.0          backports_1.1.4   ggplot2_3.2.0     pillar_1.4.2     
[16] tfruns_1.4        rlang_0.4.0       lazyeval_0.2.2    rstudioapi_0.10   data.table_1.12.2
[21] raster_2.9-23     whisker_0.3-2     callr_3.3.1       Matrix_1.2-17     reticulate_1.12  
[26] keras_2.2.4.1     desc_1.2.0        RSelenium_1.7.5   wdman_0.2.4       htmlwidgets_1.3  
[31] munsell_0.5.0     shiny_1.3.2       compiler_3.6.1    httpuv_1.5.1      pkgconfig_2.0.2  
[36] askpass_1.1       base64enc_0.1-3   pkgbuild_1.0.4    tensorflow_1.14.0 htmltools_0.3.6  
[41] openssl_1.4.1     tidyselect_0.2.5  tibble_2.1.3      codetools_0.2-16  XML_3.98-1.20    
[46] viridisLite_0.3.0 crayon_1.3.4      dplyr_0.8.3       withr_2.1.2       later_0.8.0      
[51] bitops_1.0-6      grid_3.6.1        jsonlite_1.6      xtable_1.8-4      gtable_0.3.0     
[56] magrittr_1.5      semver_0.2.0      scales_1.0.0      cli_1.1.0         fs_1.3.1         
[61] remotes_2.1.0     promises_1.0.1    sp_1.3-1          leaflet_2.0.2     testthat_2.2.1   
[66] generics_0.0.2    tools_3.6.1       Cairo_1.5-10      glue_1.3.1        purrr_0.3.2      
[71] crosstalk_1.0.0   processx_3.4.1    pkgload_1.0.2     yaml_2.2.0        colorspace_1.4-1 
[76] sessioninfo_1.1.1 caTools_1.17.1.2  memoise_1.1.0     plotly_4.9.0     

next the curl_version()

> curl_version()
$version
[1] "7.64.1"

$ssl_version
[1] "(OpenSSL/1.1.1a) Schannel"

$libz_version
[1] "1.2.8"

$libssh_version
[1] "libssh2/1.8.2"

$libidn_version
[1] NA

$host
[1] "x86_64-w64-mingw32"

$protocols
 [1] "dict"   "file"   "ftp"    "ftps"   "gopher" "http"   "https"  "imap"   "imaps"  "ldap"  
[11] "ldaps"  "pop3"   "pop3s"  "rtsp"   "scp"    "sftp"   "smtp"   "smtps"  "telnet" "tftp"  

$ipv6
[1] TRUE

$http2
[1] FALSE

$idn
[1] TRUE

When I am testing with basic code I am getting following error.

> req <- curl_fetch_memory("https://eu.httpbin.org/get?foo=123")
Error in curl_fetch_memory("https://eu.httpbin.org/get?foo=123") : 
  Unsupported proxy 'https://proxy.dom.com/', libcurl is built without the HTTPS-proxy support.

If I try following code

>   req <- curl_fetch_memory("http://httpbin.org/post", handle = h)
Error in curl_fetch_memory("http://httpbin.org/post", handle = h) : 
  Could not resolve proxy: proxy.dom.com

Thus I am also not able to install any R package from github.

I am not able to findout the cause of the error.

mallick84 avatar Aug 11 '19 23:08 mallick84

@jeroen , Waiting for your suggestions. please

mallick84 avatar Aug 19 '19 09:08 mallick84

Windows version of libcurl currently does not support HTTPS proxy, see also: https://github.com/jeroen/curl/issues/186#issuecomment-494560890

Can you use a HTTP proxy?

jeroen avatar Aug 19 '19 10:08 jeroen

I have also added a fix to the curl master branch so you can switch to openssl:

install.packages("https://github.com/jeroen/curl/archive/master.tar.gz", repos = NULL)

And then you need to set an environment variable CURL_SSL_BACKEND="openssl" when starting R.

jeroen avatar Aug 19 '19 19:08 jeroen

Thank you @jeroen, let me check out once.

mallick84 avatar Aug 20 '19 05:08 mallick84

@jeroen I have tried using CURL_SSL_BACKEND="openssl" with the latest curl version from CRAN (4.2). This gives me the following:

Initiating curl with CURL_SSL_BACKEND: openssl
Error: Failed to install 'unknown package' from GitHub:
  OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to <ipaddress>:<port>

It is the same error when using directly curl_fetch_memory.

RolandASc avatar Oct 11 '19 18:10 RolandASc

See curl/curl#3517

jay avatar Oct 11 '19 18:10 jay

@jay oh, indeed, I was not aware.

Like this it actually works with either backend... Schannel as well as openssl:

Sys.setenv(ALL_PROXY = "http://<user>:<password>@<ipaddress>:<port>/")
remotes::install_github("jeroen/V8")

or

Sys.setenv(https_proxy="http://<user>:<password>@<ipaddress>:<port>")
remotes::install_github("jeroen/V8")

or (after restarting R)

Sys.setenv(https_proxy="http://<user>:<password>@<ipaddress>:<port>")
Sys.setenv(CURL_SSL_BACKEND="openssl")
remotes::install_github("jeroen/V8")

So possibly @mallick84 faced a similar situation?

RolandASc avatar Oct 11 '19 19:10 RolandASc

Possibly. Sometimes users mistakenly use https:// for their proxy, usually in https_proxy environment variable, and other times they actually have an https proxy and need a libcurl built with support for that.

jay avatar Oct 11 '19 20:10 jay

Thank you so much @jay setting my proxy correctly (https_proxy="http://:@:") fixed this problem for me I had added httpS in the url

Dbunny avatar May 26 '20 08:05 Dbunny