anotherdj has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm installing a program on shared hosting environment that
requires LWP::UserAgent and Crypt::SSLeay


Both perl modules are installed.


The program works find for Non SSL but when it trys to access an
SSL domain nothing is returned.

Here is a snippet of what the debug using LWP::Debug ('+');

# LWP::DebugFile logging to lwp_48a4856e_a91.log
# Time now: {1218741614} = Thu Aug 14 15:20:14 2008
# Time now: {1218741615} = Thu Aug 14 15:20:15 2008
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET https://www.paypal.com
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()


The test code is:

#!/usr/bin/perl
$|= 1;
use LWP::DebugFile ('+');


use LWP::UserAgent;
use Crypt::SSLeay;

print STDOUT "Content-type: text/plain\n\n";

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;

my $response = $ua->get('https://www.paypal.com');


if ($response->is_success) {
print STDOUT $response->content;
}
else {
print STDOUT $response->status_line;
if ($result->is_error) {
print STDOUT "error\n";
my $msg = $result->error_as_HTML;
print STDOUT $msg;
}
}


exit;
  • Comment on LWP with SSL not working on a shared host server

Replies are listed 'Best First'.
Re: LWP with SSL not working on a shared host server
by zentara (Cardinal) on Aug 14, 2008 at 20:24 UTC
    I don't know what's wrong but I get segfaults trying to run your script. I can put in other addresses and it runs fine. I'm not going to try and hack thru their script security shield. They may require a cookie be set, a user agent is set to be a browser, or some sort of redirection. But it dosn't surprise me that they don't want scripts getting into their secure server. Maybe WWW::Mechanize can handle it. I'm scatching my head at the way it just segfaults. :-)

    You probably should search the SuperSearch box for "paypal", and see what they want you to do.


    I'm not really a human, but I play one on earth Remember How Lucky You Are
      Hi,

      I don't have this problem on my server and many other servers I've installed this program (not the code snippet - thats just for testing.)

      Hence its something on my client's shared host server (network solutions)

      Thanks
      David J.