cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 12 Feb 2013 09:52:14 +0100

On Tue, Feb 12, 2013 at 12:23:17PM +0530, sumit gambhir wrote:
> Thanks for the response.
>  
> But if i use Chunking with digest Auth. Curl ignore 401 response also (Ignoring
> the response-body).

The body content is irrelevant to libcurl, so it ignores it. It's not ignoring
the 401--you can see that it sends an Authorization: header in the next
request.

> 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/index HTTP/
> 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/index HTTP/
> 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

Something happened to the connection to kill it. Maybe the server didn't like
the response somehow and terminated it with extreme prejudice.

> * necessary data rewind wasn't possible

Set an CURLOPT_IOCTLFUNCTION callback to avoid this problem.

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