cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: 407 "Proxy Authentication Required" error is not communicated properly when using HTTP tunneling

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 8 Jul 2009 09:51:05 +0200 (CEST)

On Tue, 7 Jul 2009, Joshua Kwan wrote:

> - HTTP proxy *tunneling* code is used within curl, judging by the log
> messages.

> - When a download finishes, curl_multi_info_read returns CURLE_RECV_ERROR.

> - I try to use curl_easy_getinfo anyway to check for the 407, but it just
> returns 0.
>
> So there seems to be no way to discover the 407. However, the verbose
> logging we have for this situation is as follows: 'cURL debug: Received HTTP
> code 407 from proxy after CONNECT'
>
> This indicates that cURL is indeed seeing the 407, but is not passing it
> back to us. Is this a bug? Is there a better way to probe for this 407
> error? Because we need to pass it into our app.

CURLINFO_HTTP_CONNECTCODE can be used to extract the response code from
libcurl's CONNECT request. Possibly not the most obvious thing here.

Does that work for you?

-- 
  / daniel.haxx.se
Received on 2009-07-08