cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl not able to handle multiple double-quotes in 401 challenge

From: sumit gambhir <sumitgambhir9_at_gmail.com>
Date: Tue, 12 Feb 2013 12:23:17 +0530

Hi,

Thanks for the response.

But if i use Chunking with digest Auth. Curl ignore 401 response also
(Ignoring the response-body).
Please look at the logs below and let me know if i have missed something: -

* About to connect() to 10.44.104.93 port 8080 (#0)
* Trying 10.44.104.93...
* connected
* Connected to 10.44.104.93 (10.44.104.93) port 8080 (#0)
* Server auth using Digest with user 'admin'
> PUT /services/resource-lists/users/sip:5432100100_at_mircomethod.com/indexHTTP/1.1
Host: 10.44.104.93:8080
Accept: */*
x-3gpp-intended-identity:sip:5432100100_at_mircomethod.com
Content-Type:application/resource-lists+xml
Transfer-Encoding:chunked
< HTTP/1.1 401 Unauthorized
< Server: SIPMehtod
< Pragma: No-cache
< Cache-Control: no-cache
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< WWW-Authenticate: Digest realm="MemoryRealm", qop="auth",
nonce="448d849c5a6f6
94344e475c155e5bc2d", opaque="a9404e2ad97f36b3b9354abdf3e4826c"
< Content-Type: text/html;charset=utf-8
< Content-Length: 902
< Date: Tue, 12 Feb 2013 06:47:53 GMT
<
* Ignoring the response-body
* Connection #0 to host 10.44.104.93 left intact
* Issue another request to this URL: '
http://10.44.104.93:8080/services/resource
-lists/users/sip:5432100100_at_mircomethod.com/index'
* Re-using existing connection! (#0) with host (nil)
* Connected to (nil) (10.44.104.93) port 8080 (#0)
* Server auth using Digest with user 'admin'
> PUT /services/resource-lists/users/sip:5432100100_at_mircomethod.com/indexHTTP/1.1
Authorization: Digest username="admin", realm="MemoryRealm",
nonce="448d849c5a6f
694344e475c155e5bc2d",
uri="/services/resource-lists/users/sip:5432100100_at_showca
se.net/index", cnonce="MTI5NDgz", nc=00000001, qop=auth,
response="5eedab47ef6ba
94bdbf45bc3a1a3709d", opaque="a9404e2ad97f36b3b9354abdf3e4826c"
Host: 10.44.104.93:8080
Accept: */*
x-3gpp-intended-identity:sip:5432100100_at_mircomethod.com
Content-Type:application/resource-lists+xml
Transfer-Encoding:chunked
*** We read 4539 bytes from file
*** We read 0 bytes from file
* Connection died, retrying a fresh connect
* necessary data rewind wasn't possible
* Closing connection #0

Thanks and Regards,
Sumit Gambhir
On Mon, Feb 11, 2013 at 6:59 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Mon, 11 Feb 2013, sumit gambhir wrote:
>
> Following is the scenario PUT with Digest authentication: -
>> 1) Put request sent through Curl with Content-Length: 0
>> 2) Server sent 401 Challenge with domain which contains
>> multiple double-quotes like shown below logs.
>>
>> Observation-> Curl not able to handle the response and cancel the whole
>> request.
>>
>
> The 'domain' is defined in RFC2617 as:
>
> domain = "domain" "=" <"> URI ( 1*SP URI ) <">
>
> If the URL can contain a double quote, how does the parser know where to
> stop parsing the value?
>
> I take it your favorite browsers work fine with it?
>
>
> HTTP/1.1 401 Unauthorized
>> Server: Sun GlassFish Communications Server 2.0
>>
>
> WWW-Authenticate: Digest realm="micromethod.com",domain="/xcap-ap-service/
>> **resource-lists/users/ sip:5432100109_at_micromethod.**
>> com/index/~~/resource-lists/**list[@name=<http://sip:5432100109@micromethod.com/index/~~/resource-lists/list%5B@name=>
>> <http://sip:**5432100109@micromethod.com/**index/~~/resource-lists/list%*
>> *5B@name=<http://sip:5432100109@micromethod.com/index/~~/resource-lists/list%5B@name=>>"Select
>> Contact"]/entry[@uri="sip:**5432100108_at_micromethod.com<sip%3A5432100108_at_micromethod.com>"]",nonce="1357298135411:
>> **12193AA21BE9C66124B03689B219FB**A4",opaque="**
>> 0B47F922993D2B3CAAEACFECEF0476**875",stale=false,algorithm=**
>> MD5,qop="auth"
>>
>
> domain is supposed to be "A quoted, space-separated list of URIs"...
>
> --
>
> / daniel.haxx.se
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-02-12