suvallur / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Need to set proxy credentials #374

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to launch a request that needs you to pass through a proxy with 
authentication

What is the expected output? What do you see instead?
Be able to launch requests with a proxy that needs authentication

What version of the product are you using? On what operating system?
version 2.3.2 / Windows 7

I can set the proxy hostname and port but I'm not able to set proxy username 
and password. The answer explains me that credentials are missing.

Original issue reported on code.google.com by supercoo...@gmail.com on 20 Nov 2014 at 1:47

GoogleCodeExporter commented 9 years ago
I'm not all that familiar with proxies. How do you authenticate to the proxy? 
Is there a spec for that?

Original comment by johan.ha...@gmail.com on 24 Nov 2014 at 6:23

GoogleCodeExporter commented 9 years ago
Hello,

I'm talking about proxy credentials used by HTTP Client that can be declared 
like this in Java :
System.getProperties().put("http.proxyHost", "someProxyURL");
System.getProperties().put("http.proxyPort", "someProxyPort");
System.getProperties().put("http.proxyUser", "someUserName");
System.getProperties().put("http.proxyPassword", "somePassword");

Example below :
http://stackoverflow.com/questions/1626549/authenticated-http-proxy-with-java

And RFC 2069 talks about it :
https://www.ietf.org/rfc/rfc2069.txt

Original comment by supercoo...@gmail.com on 24 Nov 2014 at 8:17

GoogleCodeExporter commented 9 years ago
Oh that doesn't look so complicated. I'll try to add support for it when I find 
some time.

Original comment by johan.ha...@gmail.com on 25 Nov 2014 at 6:13

GoogleCodeExporter commented 9 years ago
I think I found something.

In com.jayway.restassured.authentication.PreemptiveBasicAuthScheme.class
line 33. The header's name is incorrect.
It should be 'Proxy-Authorization'.

Enjoy.

Original comment by soprano....@gmail.com on 24 Dec 2014 at 9:21

GoogleCodeExporter commented 9 years ago
Yes, you're right soprano !

Original comment by supercoo...@gmail.com on 24 Dec 2014 at 9:49