cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Obtaining realm

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 5 Nov 2008 19:58:37 +0100 (CET)

On Wed, 5 Nov 2008, Maxi Combina wrote:

> I am using libcurl 7.19.0. I am behind a proxy with Basic authentication,
> and need to obtain the realm that the proxy sends me with a 407 message. If
> I set CURLOPT_HEADER to 1 and set CURLOPT_WRITEFUNCTION I can see that the
> proxy sends basically this:
>
> HTTP/1.1 407 Proxy Authentication Required
> Proxy-Authenticate: Basic realm="my.domain"
>
> I could parse that and I'm done.

Funny how timely you ask this, as Josef Wolf is currently doing HTTP auth work
that also needs the realm parsed... but you're right. There's currently no
"easy" way to get the realm other than parsing the headers yourself.

> Has this feature already been implemented? If not, I _might_ have some time
> to implement it, but would greatly appreciate help for diving into libcurl
> code.

It isn't available yet, but I'm sure you can join in and help Josef Wolf get
his work done by doing a little realm parsing code.

Josef's most recent patch: http://curl.haxx.se/mail/lib-2008-11/0038.html
and his most recent reply: http://curl.haxx.se/mail/lib-2008-11/0048.html

-- 
  / daniel.haxx.se
Received on 2008-11-05