curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Username and password in URL stopped working with proxy

From: Mike Crowe via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 15 Aug 2019 13:43:02 +0100

On Thursday 15 August 2019 at 11:15:55 +0200, Daniel Stenberg wrote:
> On Thu, 15 Aug 2019, Mike Crowe wrote:
>
> > I'll have a dig into the unit test infrastructure to see if I can find a
> > way to add a test case for this. I'd previously assumed that the use of
> > a proxy would make creating a test case difficult.
>
> I believe we can reproduce this problem with a modified test 168, by moving
> the credentials into the URL. Probably worth creating a new test case from:
>
> diff --git a/tests/data/test168 b/tests/data/test168
> index 20e0b6d9c..787bd796f 100644
> --- a/tests/data/test168
> +++ b/tests/data/test168
> @@ -62,11 +62,11 @@ crypto
> </features>
> <name>
> HTTP with proxy-requiring-Digest to site-requiring-Digest
> </name>
> <command>
> -http://data.from.server.requiring.digest.hohoho.com/168 --proxy
> http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --proxy-digest --digest --user
> digest:alot
> +http://digest:alot@data.from.server.requiring.digest.hohoho.com/168 --proxy
> http://%HOSTIP:%HTTPPORT --proxy-user foo:bar --proxy-digest --digest
> </command>
> </client>
>
> # Verify data after the test has been "shot"
> <verify>

If I make that change to f078361c0e2539689df9962f35ab22f8ea25afe9, I also
have to modify the GET lines in the <protocol> section to expect the user
name and password too, because that version did send them. The test then
passes.

If I make that change to master (and don't modify the GET lines because
master doesn't supply the username and password to the proxy that way)
then no Authorization header is sent, so the test fails.

Test 168 doesn't appear to be following the numbering documented in
tests/README. If you can suggest an appropriate number for this new test
then I can create a patch to add it.

Thanks.

Mike.
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-08-15