Article delegate-en/3743 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A3742@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: passing original url as parameter for redirected webpage
31 May 2007 01:54:55 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

In message <_A3742@delegate-en.ML_> on 05/31/07(07:07:48)
you "Robert van Leiden" <ptyhabdyi-53hcb3kiuctr.ml@ml.delegate.org> wrote:
 |I've managed to implement this for http requests using the following commands:
 |-----------------------------
 |-P8080
 |SERVER=http
 |MOUNT=* http://webserver.mysite.com:8081/ProcessURL.asp?* moved
 |RES_WAIT=0
 |------------------------------b
 |
 |This works fine for http url's entered in the browser.
 |However, when entering a https url, the redirection fails.
 |
 |Also, from the logging I see I only a CONNECT request to  the destination host.
 |My questions:
 |- Is it possible to configure delegate in a way it can be used for
 |both http and https requests in this way?
 |- Is it possible to retrieve the full requested path in case of https
 |requests (insteadrf only the hostname given with the CONNECT request)?

Since the HTTPS request is encrypted in SSL, no one except the target
origin HTTPS/SSL server can see the requested URL, by principle.
But you can peep the encrypted request by DeleGate as a proxy and apply
conversion including MOUNT to it for rewriting request and response in
HTTPS by specifying an option as this:

  STLS=mitm

See <URL:http://www.delegate.org/delegate/mitm/> for more details.
But here is yet another problem. The HTTPS request is formed as a request
to the target origin server with a relative URL, not in full-URL.
It should be possible with adding one more MOUNT parameters with
MOUNT="/* vurl:https://=/*" to make full-URL for HTTPS reuqest, but
current implementation does not work so.

And I think rewriting request based on the full-URL of request in MITM
mode as in your case seems useful in general, thus I'll support it as
the enclosed patch.

Cheers,
Yutaka
--
  9 9   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( ~ )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller


*** ../../delegate9.6.1-pre4/src/httphead.c	Fri May 11 14:52:02 2007
--- httphead.c	Thu May 31 10:17:16 2007
***************
*** 1098,1108 ****
--- 1098,1121 ----
  	return opts;
  }
  int non_MOVED();
+ int vmount_fullmoved(Connection *Conn,PVStr(url)){
+ 	IStr(furl,URLSZ);
+ 	int rcode;
+ 	sprintf(furl,"%s://%s%s",DST_PROTO,OREQ_VHOST,url);
+ 	if( rcode = CTX_moved_url_to(Conn,OREQ_VHOST,REQ_METHOD,AVStr(furl)) ){
+ 		strcpy(url,furl);
+ 	}
+ 	return rcode;
+ }
  static int vmount_moved(Connection *Conn,PVStr(url))
  {	CStr(xvhost,MaxHostNameLen);
  	int rcode;
  
  	rcode = 0;
+ 	if( ServerFlags & PF_MITM_ON ){
+ 		rcode = vmount_fullmoved(Conn,BVStr(url));
+ 	}
+ 	if( rcode == 0 )
  	if( OREQ_VHOST[0] ){
  		xvhost[0] = '-';
  		wordscanX(OREQ_VHOST,QVStr(xvhost+1,xvhost),sizeof(xvhost)-1);

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V