develooper Front page | perl.libwww | Postings from September 2001

Help with LWP and Crypt-SSLeay

From:
Woodrow Brown
Date:
September 13, 2001 00:32
Subject:
Help with LWP and Crypt-SSLeay
Message ID:
3BA006E2.4010909@thenewpush.com
Hello,

I just installed the latest verions of both LWP and Crypt-SSLeay and I 
can't get the SSL connections to work. I'm running Perl version 5.6.0 
and RedHat 7.1.

HTTP Posts work fine, when I try HTTPS it seems as if nothing happens 
and then the script times out. I'm sure that the script isn't connecting 
to the remote server because I'm watching the logs on that end.

I've turned on the debugging, but I don't see any out going connections. 
Is there a way to monitor what's going on better?

Here's some code:

#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
use LWP::Debug qw(+debug +trace +conns);

my ($ua, $req, $res, $r);

## Create a user agent object ##
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);

## Create a request, either HTTP || HTTPS ##

## HTTPS ##
$req = new HTTP::Request POST => 'https://www.myserver.com/cgi-bin/test.pl';

## Set encoding ##
$req->content_type('application/x-www-form-urlencoded');

## Prepair data ##
$req->content('a=5&b=5');

# debug
print $req->as_string();

# Pass request to the user agent and get a response back
$res = $ua->request($req);

# debug
print $res->as_string();

# Check the outcome of the response
if ($res->is_success)
   {
     print $res->content;
   }
else
   {
     print "Bad luck this time\n";
     print "Failed b/c: ", $res->status_line, "\n";
   }
# end

thanks!
Woody

-- 
Woodrow Brown	| theNewPush.com
p 720.838.0919	| f 720.294.0933
web design	| linux hosting systems




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About