Comments (10)
I need to find a sample proxy server that requires authentication. Do you have one that is available publicly ?
from curl.
maybe that one : https://github.com/liggitt/auth-proxy
from curl.
quite stupid mistake in the code.
I wrote Proxy-Authenticate (which is a response header) instead of Proxy-Authorization.
I will patch right away.
from curl.
Thanks for the notice.
from curl.
Tested locally, cannot write an unit test unfortunately.
from curl.
pushing 0.0.18
from curl.
Hi
Thanks for the response and the patch .
I retired the new source.
HTTP proxy is it work. But HTTPS proxy is not work.
In HTTPS, the header set in HttpRequestBase.setConfig is not set to the proxy.
set the Proxy-Authorization with setDefaultHeaders.
It does not work when setting authentication information with the -x option.
-x http://user:password@proxyserver:8080 https://www.google.com
Caused by: java.util.concurrent.ExecutionException: org.toilelibre.libe.curl.Curl$CurlException: java.net.UnknownHostException: user:password@proxyserver
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at org.toilelibre.libe.curl.Curl.curl(Curl.java:35)
from curl.
new unit tests :
@Test
public void proxyWithAuthentication2 () {
//given
CommandLine commandLine = ReadArguments.getCommandLineFromRequest (
"-x http://localhost:80/ -U jack:insecure http://www.google.com/");
//when
HttpUriRequest request = HttpRequestProvider.prepareRequest (commandLine);
//then
assertEquals (request.getFirstHeader ("Proxy-Authorization").getValue (),
"Basic amFjazppbnNlY3VyZQ==");
assertEquals(((HttpGet)request).getConfig().getProxy().toString(), "http://localhost:80");
}
@Test
public void proxyWithAuthentication3 () {
//given
CommandLine commandLine = ReadArguments.getCommandLineFromRequest (
"-x http://jack:insecure@localhost:80/ http://www.google.com/");
//when
HttpUriRequest request = HttpRequestProvider.prepareRequest (commandLine);
//then
assertEquals (request.getFirstHeader ("Proxy-Authorization").getValue (),
"Basic amFjazppbnNlY3VyZQ==");
assertEquals(((HttpGet)request).getConfig().getProxy().toString(), "http://localhost:80");
}
from curl.
I did not work with https proxies yet.
But it will work with the http://user:password@hostname from the version 0.0.19
from curl.
closing since no activity in the feed for one week.
Please reopen in case where you are not satisfied with the assistance.
from curl.
Related Issues (20)
- Certificate paths are incorrectly handled on Windows HOT 4
- is it possible to add --connect-timeout and --max-time. HOT 5
- way to get the response HOT 2
- StackOverflowError on POST with large json data HOT 4
- stackoverflowErorr for long curl, where we are calling `getArgsFromCommand()` HOT 1
- Argument -L doesn't work HOT 6
- add option for keystore password HOT 7
- Some Assistance re: Curl Parameters. HOT 2
- use dataurlencode HOT 4
- -k parameter for unsupported TLS algorithms does not work HOT 7
- Can not upload a file HOT 6
- Upload base64 file stack overflow error HOT 4
- Streaming HOT 2
- sends two user-agent HOT 3
- java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64 HOT 2
- Some help please. HOT 10
- sftp curl example HOT 1
- -T parameter support missing HOT 1
- proxy bug HOT 1
- ReadArguments OutOfMemoryError bug HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curl.