Article delegate-en/2533 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]

Newsgroups: mail-lists.delegate-en

[DeleGate-En] Problem with cgi and https POST method
06 Feb 2004 19:23:43 GMT p4ueqbdyi-y27ap3p5sbfr.ml@ml.delegate.org




Hi Yutaka,

we have a problem with cgi-filtering of POST-Messages. The perl -script uses
CGI-module and retrieves the data correctly, but the transmission hangs after
the upload. Do we have to modify/rewrite the headers?

Our configuration is:

for the https-proxy:

DGROOT="/home/ammaramm/delegate"
DGPATH="/home/ammaramm/delegate"
DATAPATH="/home/ammaramm/delegate"
VARDIR="/home/ammaramm/delegate"
CACHEDIR="/home/ammaramm/delegate/cache"
TMPDIR="/home/ammaramm/delegate/tmp"
LOGDIR="/home/ammaramm/delegate/log"
SERVER=https
FCL=/home/ammaramm/delegate/lib/sslway -cert
/home/ammaramm/delegate/lib/server-cert.pem -key
/home/ammaramm/delegate/lib/server-key.pem -ad -st
FTOSV=/home/ammaramm/delegate/lib/socket.cfi
SSLTUNNEL=217.111.41.40:8088
CACHE=no
EXPIRE=0d

for the master:

DGROOT="/home/ammaramm/delegate"
DGPATH="/home/ammaramm/delegate"
DATAPATH="/home/ammaramm/delegate"
VARDIR="/home/ammaramm/delegate"
CACHEDIR="/home/ammaramm/delegate/cache"
TMPDIR="/home/ammaramm/delegate/tmp"
LOGDIR="/home/ammaramm/delegate/log"
FSV=/home/ammaramm/delegate/lib/sslway -cert
/home/ammaramm/delegate/lib/server-cert.pem -key
/home/ammaramm/delegate/lib/server-key.pem
CACHE=no
EXPIRE=0d

the cfi-file:

#!cfi
Content-type: multipart/
CGI: /home/ammaramm/delegate/lib/test.cgi

and the script:

use CGI qw(:standard);
my $q = new CGI;

my $header_string ="";
# getting additional headerstrings out of environment variables
foreach my $var (keys(%ENV)) {
   my $val = $ENV{$var};
   if (${var} =~ /^HTTP_/i) {
      next if ${var} =~ /CONNECT/i;
      $val =~ s|\n|\\n|g;
      $val =~ s|"|\\"|g;
      ${var} =~ s/^HTTP_//gi;
      ${var} =~ s/_/-/g;
      @vall = split(/;/, ${val});
      print "${var}: $vall[0] \n";
   }elsif(${var} =~ /^CONTENT_TYPE/i) {
  $val =~ s|\n|\\n|g;
      $val =~ s|"|\\"|g;
       @vall = split(/;/, ${val});
      print "Content-Type: $vall[0]\n";
   }
}
print "\n";
#writing upload file
$blksize = $ENV{'CONTENT_LENGTH'};

$len = sysread STDIN, $buf,$blksize;

syswrite STDOUT, $buf, $len;

print  "\032";
exit;

If everything works the browsers connects to the https-proxy, multipart-contents
 is filtered before transmisssion to the master, who connects to the webserver.
Everything works without the filter! We also managed to scan downloaded files
for viruses successfully. We chained the upload into a file and everything
looked good.
When we transferred less then CONTENT-LENGTH data, we got a Bad File response
from the webserver.


Thank you very much

Peter Jansen and Ammar Ammar



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