You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Hendrik Harms <he...@gmail.com> on 2005/11/01 16:39:00 UTC

Proxy-Authorization needed for ProxyRemote

proxy_http.c:966

/* XXX: @@@ FIXME: "Proxy-Authorization" should *only* be
 * suppressed if THIS server requested the authentication,
 * not when a frontend proxy requested it!
 *
 * The solution to this problem is probably to strip out
 * the Proxy-Authorisation header in the authorisation
 * code itself, not here. This saves us having to signal
 * somehow whether this request was authenticated or not.
 */
 || !strcasecmp(headers_in[counter].key,"Proxy-Authorization")
 || !strcasecmp(headers_in[counter].key,"Proxy-Authenticate")) {


I think this code denies any connection to a Forward-Proxy with
Proxy-Authorization even if I try to fake the Proxy-Authorization
Header with mod_headers (RequestHeader).

I know that the Proxy-Authorization Header is a Hop-to-Hop Header
that should be filtered. But the apache is neither able to send a
407 Response nor able to verify the Proxy-Authorization Header.
So I think it would be the best to pass through the Proxy-Authorization
Header.

If this is not possible, it would be nice to have something like
  ProxyRemote * http://proxy-user:proxy-password@forward.proxy.com

Regards,
Hendrik

--
----------------------------------------------------------
Hendrik Harms

Re: Proxy-Authorization needed for ProxyRemote

Posted by Hendrik Harms <he...@gmail.com>.
2005/11/1, Hendrik Harms <he...@gmail.com>:
> proxy_http.c:966
>
> .....
> If this is not possible, it would be nice to have something like
>   ProxyRemote * http://proxy-user:proxy-password@forward.proxy.com
>

to add this feature, I think it is necassary to extend the struct
proxy_remote in mod_proxy.h:

  struct proxy_remote {
      const char *scheme;         /* the schemes handled by this
proxy, or '*' */
      const char *protocol;         /* the scheme used to talk to this proxy */
+    const char *auth_name;     /* the userid to authenticate at this proxy */
+    const char *auth_passwd;  /* the passwd to authenticate at this proxy */
      const char *hostname;       /* the hostname of this proxy */
      apr_port_t  port;                /* the port for this proxy */
      regex_t *regexp;               /* compiled regex (if any) for
the remote */
      int use_regex;                  /* simple boolean. True if we
have a regex pattern */
  };


and change the API of the proxy_hook_scheme_handler

APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, scheme_handler, (request_rec *r,
                          proxy_server_conf *conf, char *url,
-                          const char *proxyhost, apr_port_t proxyport))
+                         const struct proxy_remote *proxyremote))


regards,
Hendrik