CONNECT through proxy
"Sylvain Thibault" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Message-ID | <9AD7388844E645D9A5693CDB468E8ADC@Trading> |
I am issuing a CONNECT request to a non standard server.
Somehow the request is successfull when going through a proxy server and fails when issued directly to the server...
I cannot figure out what the proxy does different to make the request successful.
#! /usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;
my $browser = LWP::UserAgent->new(keep_alive => 1);
$browser->agent('');
$browser->proxy(['http','https'], 'http://127.0.0.1:8888');
my $r = HTTP::Request->new('CONNECT', 'https://10.200.32.171:11025');
$r->header(Host => '10.200.32.171:11025');
$bytes = '4835...';
$r->content($bytes);
push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, SendTE => 0, PeerHTTPVersion => "1.1");
my $response = $browser->request($r);
With the proxy, I get 200 Connection established with a working socket,
without the proxy, I get 500 SLL negociation failed.
Probably something obvious :-)
Thank you for your help,
Sylvain Thibault