cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Test proxy authentication parameters

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 30 Sep 2010 00:04:49 +0200 (CEST)

On Tue, 28 Sep 2010, Andrey Bocharnikov wrote:

> Is it possible to make authentication on proxy, without further requests
> through this proxy?

If you talk regular HTTP and a HTTP proxy, you authenticate to the proxy by
doing a request to/through it. And no, you don't need to do any further
requests using that proxy after that.

> 1) Connecting directly to proxy server URL with CURLOPT_URL option (without
> using proxy server - CURLOPT_PROXY option) with specified authentication
> parameters.
> Proxy replies ERR_INVALID_URL.

The proxy doesn't necessarily respond as a server. It is a proxy so you need
to talk proxy language to it.

> If I set CONNECT_ONLY option additionally, it just establish connection with
> proxy without authentication. So i can't understand if authentication
> parameters are correct.

CONNECT_ONLY would apply to the connection to the end point, which isn't the
proxy. The proxy is just a ... eh proxy, a middle man. It can't be a middle if
there's no end point on the other side of the proxy that you're reaching out
to.

> 2) Connecting to some server like "always.alive.server.com" with specified
> proxy and CONNECT_ONLY option. But in this case there is also no
> authentication happened.

You need to set CURLOPT_PROXYAUTH with your prefered auth methods and you
should probably not use CONNECT_ONLY.

> So general question: is it possible to authenticate on proxy without request
> to another URL?

Not if you're talking about a HTTP proxy. There's no separate authentication
with a proxy then.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-09-30