For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > December 2004 > Help with https









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help with https
Philip Tham

2004-12-16, 3:56 am

Hi

I am trying to access a secured page using the code below. The page is
accessible with firefox using the proxy at proxy.inhouse.com port 8080.

On doing a snoop on the data while using firefox I can see a CONNECT
being sent to the website intranet.mysecuredpage.net directed to the
proxy unencrypted and after receiving an OK SSL handshake starts and a
client hello is being sent to the proxy. After receceiving a Server
Hello information is exchanged and the web page is received encrypted.

On using perl and my code below, I am not seeing the CONNECT going out.
Instead a Client Hello is immediately being sent out to the proxy from
the client running the perl code.

Need some advise if anybody knows about this problem.

Philip




#!/usr/bin/perl
use strict;
use Crypt::SSLeay;
use URI::https;
use LWP::Protocol::https;
use LWP::UserAgent;
use HTTP::Request;
my $ua = LWP::UserAgent->new(keep_alive => 1, timeout =>30);
$ua->proxy('https','https://proxy.inhouse.com:8080');
my $rq=HTTP::Request->new(GET => "https://intranet.mysecuredpage.net");
my $rsp=$ua->request($rq);
print $rsp->code;
print "\n";


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com