RCurl getURL with FTP over proxy - r

In R I'm trying to get data from a ftp server using RCurl. The server has explicit encryption activated. Below one of the many attempts to make this work but I always get 530 Login or password incorrect! Still the username / password works when using another client like WinSCP. Any help is welcome!
library(RCurl)
# CURL_SSLVERSION_TLSv1_1 <- 5L
# CURL_SSLVERSION_TLSv1_2 <- 6L
opts <- curlOptions(
proxy = "http://my.proxy/",
proxyport = 8080,
dirlistonly = TRUE,
sslversion = 6L,
ftp.use.epsv = FALSE,
ssl.verifypeer=TRUE
)
dat <- getURL("ftp://myUser:myPaas#ftps.myServer.com/", .opts = opts )
Here some screenshots of the winscp setup (only German OS available)
Connection screen:
Protocol screen:
WinSCP connection string:
Here is the output having verbose = TRUE added
* Trying 10.x.x.x...
* Connected to 10.x.x.x (10.x.x.x) port 8080 (#0)
> GET ftp://User:Pass#ftp.myserver.com/ HTTP/1.1
Host: ftp.myserver.com:21
Accept: */*
Proxy-Connection: Keep-Alive
< HTTP/1.1 403 Forbidden
< Server: squid/3.5.20
< Mime-Version: 1.0
< Date: Thu, 15 Nov 2018 11:12:24 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 3898
< X-Squid-Error: ERR_FTP_FORBIDDEN 530
< Vary: Accept-Language
< Content-Language: en
< WWW-Authenticate: Basic realm="FTP ftp.myserver.com"
< X-Cache: MISS from Proxy-xxxxxx
< X-Cache-Lookup: MISS from Proxy-xxxxx:8080
< Via: 1.1 Proxy-xxxxxx (squid/3.5.20)
< Connection: keep-alive
<
* Connection #0 to host 10.x.x.x left intact
Here is the WinSCP log:
. 2018-11-15 17:09:15.999 Verbinde mit ftp.MyServer.com ...
. 2018-11-15 17:09:15.999 HTTP proxy command: CONNECT ftp.MyServer.com:21 HTTP/1.1
. 2018-11-15 17:09:15.999 Host: ftp.MyServer.com:21
. 2018-11-15 17:09:16.014 Verbindung mit dem Proxy hergestellt, führe Handshakes aus ...
. 2018-11-15 17:09:16.039 HTTP proxy response: HTTP/1.1 200 Connection established
. 2018-11-15 17:09:16.039 HTTP proxy headers:
. 2018-11-15 17:09:16.039
. 2018-11-15 17:09:16.039 Verbunden mit ftp.MyServer.com, TLS Verbindung wird ausgehandelt...
< 2018-11-15 17:09:16.059 220 Welcome to FTP MyServer
> 2018-11-15 17:09:16.059 AUTH TLS
< 2018-11-15 17:09:16.093 234 Using authentication type TLS
. 2018-11-15 17:09:16.179 Verifying certificate for "MY Server" with fingerprint xx:yy:zz.............. and 18 failures
. 2018-11-15 17:09:16.179 Certificate common name "ftp.MyServer.com" matches hostname
. 2018-11-15 17:09:16.179 Certificate for "MY Server" matches cached fingerprint and failures
. 2018-11-15 17:09:16.179 Using TLSv1.2, cipher TLSv1/SSLv3: ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA, ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD
. 2018-11-15 17:09:16.216 TLS Verbindung hergestellt. Warte auf die Willkommensnachricht...
> 2018-11-15 17:09:16.216 USER MyUser
< 2018-11-15 17:09:16.216 331 Password required for MyUser
> 2018-11-15 17:09:16.216 PASS **********
< 2018-11-15 17:09:16.236 230 Logged on
Here is the R console log with more info:
* Trying 10.101.0.32...
* Connected to 10.101.0.32 (10.x.x.x) port 8080 (#0)
> GET ftp://MyUser:#ftp.MyServer.com/ HTTP/1.1
Host: ftp.MyServer.com:21
Accept: */*
Proxy-Connection: Keep-Alive
< HTTP/1.1 401 Unauthorized
< Server: squid/3.5.20
< Mime-Version: 1.0
< Date: Fri, 16 Nov 2018 08:25:46 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 3898
< X-Squid-Error: ERR_FTP_FORBIDDEN 530
< Vary: Accept-Language
< Content-Language: en
< WWW-Authenticate: Basic realm="FTP MyServer ftp.MyServer.com"
< X-Cache: MISS from Proxy-xxxx
< X-Cache-Lookup: MISS from Proxy-xxxx:8080
< Via: 1.1 Proxy-xxxx (squid/3.5.20)
< Connection: keep-alive
<
* Ignoring the response-body
* Connection #0 to host 10.x.x.x left intact
* Issue another request to this URL: 'ftp://ftp.MyServer.com'
* Found bundle for host ftp.MyServer.com: 0xafea17a
* Re-using existing connection! (#0) with host 10.x.x.x
* Connected to 10.x.x.x (10.x.x.x) port 8080 (#0)
* Server auth using Basic with user 'Nordex'
> GET ftp://MyUser:#ftp.MyServer.com/ HTTP/1.1
Authorization: Basic Tm9yZGV50g==
Host: ftp.MyServer.com:21
Accept: */*
Proxy-Connection: Keep-Alive
< HTTP/1.1 401 Unauthorized
< Server: squid/3.5.20
< Mime-Version: 1.0
< Date: Fri, 16 Nov 2018 08:25:46 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 3947
< X-Squid-Error: ERR_FTP_FORBIDDEN 530
< Vary: Accept-Language
< Content-Language: en
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="FTP MyServer ftp.MyServer.com"
< X-Cache: MISS from Proxy-xxxx
< X-Cache-Lookup: MISS from Proxy-xxxx:8080
< Via: 1.1 Proxy-xxxx (squid/3.5.20)
< Connection: keep-alive
<
* Connection #0 to host 10.x.x.x left intact

WinSCP sends CONNECT command to proxy:
. 2018-11-15 17:09:15.999 HTTP proxy command: CONNECT ftp.MyServer.com:21 HTTP/1.1
While RCurl sends GET command:
> GET ftp://User:Pass#ftp.myserver.com/ HTTP/1.1
In cURL, you use CURLOPT_HTTPPROXYTUNNEL option to make it use CONNECT:
make libcurl tunnel all operations through the HTTP proxy (set with CURLOPT_PROXY). There is a big difference between using a proxy and to tunnel through it.
Tunneling means that an HTTP CONNECT request is sent to the proxy, asking it to connect to a remote host on a specific port number and then the traffic is just passed through the proxy.
In RCurl, that corresponds to httpproxytunnel. So this should do:
opts <- curlOptions(
proxy = "http://my.proxy/",
proxyport = 8080,
httpproxytunnel = 1,
...
)

Related

Curl doesn't return anything

I have a web app hosted at A.B.C.D:5601 and when I try curl A.B.C.D:5601 it doesn't print out anything on the screen however when I open the same link using a browser it does open the webapp. But it gets forwarded to A.B.C.D:5601/foo/bar and it opens fine.
Here is the output of curl -v
* Trying A.B.C.D:5601...
* TCP_NODELAY set
* Connected to A.B.C.D port 5601 (#0)
> GET / HTTP/1.1
> Host: A.B.C.D:5601
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< location: /spaces/enter
< x-content-type-options: nosniff
< referrer-policy: no-referrer-when-downgrade
< cache-control: private, no-cache, no-store, must-revalidate
< content-length: 0
< Date: Tue, 08 Jun 2021 03:01:11 GMT
< Connection: keep-alive
< Keep-Alive: timeout=120
<
* Connection #0 to host A.B.C.D left intact
Why is curl not giving me the response back?
Curl is telling you you are being redirected to /spaces/enter.
You can tell Curl to automatically follow redirects:
curl -vL [url]

RCurl (with digest authentication) not setting realm correctly on Windows

I've been working on an R interface to a HTTP API with digest authentication and I've been running into a problem wherein the request will work absolutely fine on my non-Windows OSs, but I always get 401 status when running exactly the same code on Windows.
I'm currently trying to do it with RCurl, but the same thing was happening with httr when I tried that.
Also the API is unfotunately proprietary so I've had to change all the URLs, sorry.
On my non-Windows OSs I get the following behaviour:
rprompt> getURL('http://demo.someapi.net/some/url', userpwd="demo:demo", httpauth=1L, verbose=TRUE)
* Trying 195.224.16.34...
* Connected to demo.someapi.net (195.224.16.34) port 443 (#0)
* TLS 1.0 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate: *.someapi.net
* Server certificate: RapidSSL SHA256 CA - G3
* Server certificate: GeoTrust Global CA
> GET /some/url HTTP/1.1
Host: demo.someapi.net
Accept: */*
< HTTP/1.1 401 Unauthorized
< Cache-Control: no-cache
< Content-Type: text/html
< Server: Microsoft-IIS/7.5
< WWW-Authenticate: Digest realm="company.product", nonce="MTEvMDcvMjAxNiAwODo0NTozMw", opaque="0000000000000000", stale=false, algorithm=MD5, qop="auth"
< X-Powered-By: ASP.NET
< Date: Mon, 11 Jul 2016 08:44:33 GMT
< Content-Length: 1293
<
* Ignoring the response-body
* Connection #0 to host demo.someapi.net left intact
* Issue another request to this URL: 'https://demo.someapi.net/some/url'
* Found bundle for host demo.someapi.net: 0x7f96c8d55af0
* Re-using existing connection! (#0) with host demo.someapi.net
* Connected to demo.someapi.net (195.224.16.34) port 443 (#0)
* Server auth using Digest with user 'demo'
> GET /some/url HTTP/1.1
Host: demo.someapi.net
Authorization: Digest username="demo", realm="company.product", nonce="MTEvMDcvMjAxNiAwODo0NTozMw", uri="/some/url", cnonce="YjRkMDQxYmM4MDFkYTMxOWZhNTViNGNmYTM5YzQyNGI=", nc=00000001, qop=auth, response="5d9643d083b2380f12d71855a98ceac3", opaque="0000000000000000", algorithm="MD5"
Accept: */*
< HTTP/1.1 200 OK
< Cache-Control: private
< Content-Length: 981
< Content-Type: application/json; charset=utf-8
< Server: Microsoft-IIS/7.5
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Mon, 11 Jul 2016 08:44:33 GMT
<
* Connection #0 to host demo.someapi.net left intact
and evertything works exactly as we expect it to. On Windows however we get this:
rprompt> getURL('http://demo.someapi.net/some/url', userpwd="demo:demo", httpauth=1L, verbose=TRUE)
* Trying 195.224.16.34...
* Connected to demo.someapi.net (195.224.16.34) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: C:/Users/username/Documents/R/win-library/3.3/RCurl/etc/ca-bundle.crt
CApath: none
* SSL connection using TLSv1.0 / ECDHE-RSA-AES256-SHA
* Server certificate:
* subject: OU=GT56411961; OU=See www.rapidssl.com/resources/cps (c)15; OU=Domain Control Validated - RapidSSL(R); CN=*.someapi.net
* start date: 2015-01-26 09:31:11 GMT
* expire date: 2018-03-28 16:30:51 GMT
* subjectAltName: demo.someapi.net matched
* issuer: C=US; O=GeoTrust Inc.; CN=RapidSSL SHA256 CA - G3
* SSL certificate verify ok.
> GET /some/url HTTP/1.1
Host: demo.someapi.net
Accept: */*
< HTTP/1.1 401 Unauthorized
< Cache-Control: no-cache
< Content-Type: text/html
< Server: Microsoft-IIS/7.5
< WWW-Authenticate: Digest realm="company.product", nonce="MTEvMDcvMjAxNiAwODo1MjowOA", opaque="0000000000000000", stale=false, algorithm=MD5, qop="auth"
< X-Powered-By: ASP.NET
< Date: Mon, 11 Jul 2016 08:51:07 GMT
< Content-Length: 1293
<
* Ignoring the response-body
* Connection #0 to host demo.someapi.net left intact
* Issue another request to this URL: 'https://demo.someapi.net/some/url'
* Found bundle for host demo.someapi.net: 0xaa60b80
* Re-using existing connection! (#0) with host demo.someapi.net
* Connected to demo.someapi.net (195.224.16.34) port 443 (#0)
* Server auth using Digest with user 'demo'
> GET /some/url HTTP/1.1
Authorization: Digest username="demo",realm="",nonce="MTEvMDcvMjAxNiAwODo1MjowOA",uri="/some/url",cnonce="553f542ddef0e3c265e50539297bad81",nc=00000001,algorithm=MD5,response="1ec58793bb1d8142f09af112b905fa36",qop="auth",opaque="0000000000000000"
Host: demo.someapi.net
Accept: */*
< HTTP/1.1 401 Unauthorized
< Cache-Control: no-cache
< Content-Type: text/html
< Server: Microsoft-IIS/7.5
* Authentication problem. Ignoring this.
< WWW-Authenticate: Digest realm="company.product", nonce="MTEvMDcvMjAxNiAwODo1MjowOA", opaque="0000000000000000", stale=false, algorithm=MD5, qop="auth"
< X-Powered-By: ASP.NET
< Date: Mon, 11 Jul 2016 08:51:07 GMT
< Content-Length: 1293
<
* Connection #0 to host demo.someapi.net left intact
which just returns a 401 landing page HTML.
The issue seems to be that the realm field is empty, but I have no idea how to fix this or even how to work around it.
It should be noted that both .NET's webclient and Python's requests library handles things fine, but unfortunately this has to be done in R.
I'm happy to use any R packages that are needed to help solve this.
Thanks.
For anyone else who ends up with a similar problem, you can get around it by using httr and using your own handles.
make.request <- function (url, user, pass) {
handle <- httr::handle(url)
response <- GET(url=NULL, authenticate(user, pass, type="digest"), handle=handle)
# error checking and stuff...
}
I'm not sure what the issue is with RCurl though.

cURL authorization on ASP.NET website

Can anyone help me to figure out what am I doing wrong?
What do we have:
A website where I need to log in via cURL.
Credentials of two accounts that have to be logged in.
What did I get
I managed to log in only one account via cURL, but can't log in the second one. However I can log in with both of them via browser.
What did I try
this one works fine
curl --verbose --location -b ~/cookie.txt -c ~/cookie.txt
--data "tbLogin=login1&tbPassword=password1&btSubmit=Войти"
http://online.tmtr.ru/login.aspx
this one doesn't
curl --verbose --location -b ~/cookie.txt -c ~/cookie.txt
--data "tbLogin=login2&tbPassword=password2&btSubmit=Войти"
http://online.tmtr.ru/login.aspx
The only difference is in the logins and passwords.
I also tried to use separate cookie files for each account.
Here are the logs
Working account:
* About to connect() to online.tmtr.ru port 80 (#0)
* Trying 109.73.3.134...
* connected
* Connected to online.tmtr.ru (109.73.3.134) port 80 (#0)
> POST /login.aspx HTTP/1.1
> User-Agent: curl/7.26.0
> Host: online.tmtr.ru
> Accept: */*
> Cookie: _some_cookie_data_
> Content-Length: 59
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 59 out of 59 bytes
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 302 Found
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Location: /main.aspx
< Server: Microsoft-IIS/8.5
< X-AspNet-Version: 2.0.50727
* Replaced cookie _some_cookie_data_
< Set-Cookie: _some_cookie_data_
< X-Powered-By: ASP.NET
< Date: Wed, 02 Dec 2015 13:49:39 GMT
< Content-Length: 129
<
* Ignoring the response-body
* Connection #0 to host online.tmtr.ru left intact
* Issue another request to this URL: 'http://online.tmtr.ru/main.aspx'
* Violate RFC 2616/10.3.3 and switch from POST to GET
* Re-using existing connection! (#0) with host (nil)
* Connected to (nil) (109.73.3.134) port 80 (#0)
> GET /main.aspx HTTP/1.1
> User-Agent: curl/7.26.0
> Host: online.tmtr.ru
> Accept: */*
> Cookie: _some_cookie_data_
>
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Server: Microsoft-IIS/8.5
< X-AspNet-Version: 2.0.50727
< X-Powered-By: ASP.NET
< Date: Wed, 02 Dec 2015 13:49:39 GMT
< Content-Length: 150950
<
<!-- Here goes the html of the page with user's account -->
Problem account:
* About to connect() to online.tmtr.ru port 80 (#0)
* Trying 109.73.3.134...
* connected
* Connected to online.tmtr.ru (109.73.3.134) port 80 (#0)
> POST /login.aspx HTTP/1.1
> User-Agent: curl/7.26.0
> Host: online.tmtr.ru
> Accept: */*
> Cookie: _some_cookie_data_
> Content-Length: 56
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 56 out of 56 bytes
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 302 Found
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Location: /main.aspx
< Server: Microsoft-IIS/8.5
< X-AspNet-Version: 2.0.50727
* Replaced cookie _some_cookie_data_
< Set-Cookie: _some_cookie_data_
< X-Powered-By: ASP.NET
< Date: Wed, 02 Dec 2015 13:45:10 GMT
< Content-Length: 129
<
* Ignoring the response-body
* Connection #0 to host online.tmtr.ru left intact
* Issue another request to this URL: 'http://online.tmtr.ru/main.aspx'
* Violate RFC 2616/10.3.3 and switch from POST to GET
* Re-using existing connection! (#0) with host (nil)
* Connected to (nil) (109.73.3.134) port 80 (#0)
> GET /main.aspx HTTP/1.1
> User-Agent: curl/7.26.0
> Host: online.tmtr.ru
> Accept: */*
> Cookie: _some_cookie_data_
>
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 302 Found
< Cache-Control: private
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=utf-8
< Location: /error.aspx?aspxerrorpath=/main.aspx
< Server: Microsoft-IIS/8.5
< X-AspNet-Version: 2.0.50727
< X-Powered-By: ASP.NET
< Date: Wed, 02 Dec 2015 13:45:10 GMT
<
* Ignoring the response-body
* Connection #0 to host (nil) left intact
* Issue another request to this URL: 'http://online.tmtr.ru/error.aspx?aspxerrorpath=/main.aspx'
* Re-using existing connection! (#0) with host (nil)
* Connected to (nil) (109.73.3.134) port 80 (#0)
> GET /error.aspx?aspxerrorpath=/main.aspx HTTP/1.1
> User-Agent: curl/7.26.0
> Host: online.tmtr.ru
> Accept: */*
> Cookie: _some_cookie_data_
>
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Server: Microsoft-IIS/8.5
< X-AspNet-Version: 2.0.50727
< X-Powered-By: ASP.NET
< Date: Wed, 02 Dec 2015 13:45:10 GMT
< Content-Length: 405
<
<!-- Here goes the html of the page with error -->
As I mentioned before, I can successfully log in with both of the accounts via the browser.
How can I figure out why the server rejects one of the accounts via curl but doesn't via browser?
I also tried to send request via Postman extention for the Chrome browser and it works just fine too.
It is because, when you do login using the second account, it is using the cookie from the previously saved cookie. And when server sees a valid cookie, it just redirect you into a different location (or something else decided by the server).
To overcome this, just flush the cookie file before the second curl.
echo ''> ~/cookie.txt
I've contacted with the owner of that site and it turned out that there is a custom validation of the "accept language" header. I didn't send this header at all. I don't know why some requests passed validation and some not, but after I added this header to my requests all gone well :)

Riak Server Returning Error 404

I've installeld Riak 2 on a Centos 6 box and I've managed to boot Riak but now get this error when I try to test it:
curl -v http://<hostname>:8098/types/default/props
* About to connect() to <hostname> port 8098 (#0)
* Trying <hostname>... connected
* Connected to <hostname> (<hostname>) port 8098 (#0)
> GET /types/default/props HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: <hostname>:8098
> Accept: */*
>
< HTTP/1.1 404 Object Not Found
< Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
< Date: Fri, 21 Aug 2015 01:02:48 GMT
< Content-Type: text/html
< Content-Length: 193
<
* Connection #0 to host <hostname> left intact
* Closing connection #0
<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>[root#riak1 ~]#
Also I did modify my apps.config and vm like so:
{pb, [ {"", 8087 } ]}
{http, [ {"", 8098 } ]},
-name riak#
What does this mean and how do I fix it?

unable to connect R through proxy

I´m trying to scrape a web page using a proxy but something isn´w working.
Here is an httr attemp to set the proxy options, below i try with RCurl.
I´ve read several answers regarding the subject but they don´t seem to be working.
Any suggestions?
### httr attempt
set_config(
use_proxy(url="proxy.xxx.com.ar", port=8080,
username = "xxxx\\xxxx", password = "xxxxx"),
override = TRUE
)
a <- GET("http://google.com/", verbose())
-> GET http://google.com/ HTTP/1.1
-> Proxy-Authorization: Basic dG1vdmlsZXNcbWFyYmVsOkFyYWNhbGFjYW5hMjM=
-> User-Agent: curl/7.19.7 Rcurl/1.95.4.1 httr/0.4.0.99
-> Host: google.com
-> Accept: */*
-> Accept-Encoding: gzip
-> Proxy-Connection: Keep-Alive
->
<- HTTP/1.1 407 Proxy Authentication Required
<- Server: pxsip02-srv.xxxxx.com.ar
<- Date: Mon, 11 Aug 2014 15:11:14 GMT
<- Content-Length: 309
<- Content-Type: text/html
<- Connection: Keep-Alive
<- Keep-Alive: timeout=60, max=8
<- Proxy-Authenticate: NTLM
<-
content(a)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head><title>Authentication Error</title></head>
<body>
<h1>Authentication Error</h1>There has been an error validating your user credentials. If the error persists,contact your network administrator.<br>Proxy authentication required<br><hr>
<br>Details: 407 Proxy Authentication Required</body>
</html>
### RCurl attempt
library("RCurl")
opts <- list(
proxy = "proxy.xxxxx.com.ar",
proxyusername = "xxxxxx\\xxxxx",
proxypassword = "xxxxxx",
proxyport = 8080,
capath = system.file("CurlSSL", "cacert.pem", package = "RCurl"),
verbose=TRUE, proxyauth=TRUE, useragent= "", header = TRUE
)
options( RCurlOptions = opts)
getURL("http://stackoverflow.com")
* About to connect() to proxy proxy.xxxxx.com.ar port 8080 (#0)
* Trying 10.167.195.11... * connected
* Connected to proxy.xxxxxx.com.ar (10.167.195.11) port 8080 (#0)
* Proxy auth using Basic with user 'xxxxxxx\xxxxx'
> GET http://stackoverflow.com HTTP/1.1
Proxy-Authorization: Basic VE1PVklMRVNcTUFSQkVMOkFyYWNhbGFjYW5hMjM=
Host: stackoverflow.com
Accept: */*
Proxy-Connection: Keep-Alive
[1] "HTTP/1.1 407 Proxy Authentication Required\r\nServer: pxsip02-srv.xxxx.com.ar\r\nDate: Mon, 11 Aug 2014 15:15:29 GMT\r\nContent-Length: 309\r\nContent-Type: text/html\r\nConnection: Keep-Alive\r\nKeep-Alive: timeout=60, max=8\r\nProxy-Authenticate: NTLM\r\n\r\n<html><head><title>Authentication Error</title></head><body><h1>Authentication Error</h1>There has been an error validating your user credentials. If the error persists,contact your network administrator.<br/>Proxy authentication required<br/><hr/><br/>Details: 407 Proxy Authentication Required</body></html>"
< HTTP/1.1 407 Proxy Authentication Required
< Server: pxsip02-srv.xxxxxxx.com.ar
< Date: Mon, 11 Aug 2014 15:15:29 GMT
< Content-Length: 309
< Content-Type: text/html
< Connection: Keep-Alive
< Keep-Alive: timeout=60, max=8
< Proxy-Authenticate: NTLM
<
* Connection #0 to host proxy.xxxxxx.com.ar left intact
Here is the update of the previous question. I add it as another answer so it´s easier to follow.
GET("http://google.com/",
config = list(
use_proxy(url="proxy.xxx.com.ar", port=8080,
username = "xxxx\\xxxx", password = "xxxxx",
proxyauth = 1)
)
)
The error messege:
Error in use_proxy(url = "proxy.xxxx.com.ar", port = 8080, username = "xxxxxx\\xxxx", :
unused argument (proxyauth = 1)

Resources