Thread

Posted on Mon Feb 6 16:17:56 2006 by borix69
Problem downloading files
Hi,

I'm getting a little bit extra-crazy with the Crypt::SSLeay perl module. My problem is next:

I've got a script that downloads a file from a HTTPS server with CA authentication. My script seams like:

/******************************************************/
my $ua = LWP::UserAgent->new;

$ua->timeout(20);

$nombrefichero = shift(@ARGV);
my @URLS = ('https://midominio/' . $nombrefichero);

my $response = $ua->get($laurl);
/******************************************************/

Well, the fact is that when I run the perl script (/usr/bin/perl myperlscript myfilename) from the linux console with the root superuser, It works ok, but if I run it with another user than root or even if I try to schedule (cron) with the root, it fails and return this error log message:

/******************************************************/
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET https://mydomain/mifilename
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: Internal Server Error
/******************************************************/

I dont know what to do with it so... do you have any idea about what maybe the problem ?

Thanks a lot.
Direct Responses: 1763 | 4202 | Write a response
Posted on Mon Feb 6 16:22:28 2006 by borix69 in response to 1762
Re: Problem downloading files
Sorry, I mistake the perl code, the real code is:

/******************************************************/
my $ua = LWP::UserAgent->new;

$ua->timeout(20);
my $URLS = ('https://mydomain/myfile');

my $response = $ua->get($URL);
/******************************************************/

and the problem is still there.
Write a response
Posted on Tue Jan 30 13:03:21 2007 by grinder in response to 1762
Re: Problem downloading files

Crypt-SSLeay uses a number of environment variables to control its behaviour. Could it be that when run from the shell, the appropriate environment variables are set, but not when run from cron?

At the beginning of your program, add the following snippet to dump the environment table:

print "$_: $ENV{$_}\n" for sort keys %ENV;

and compare the results when run from the command line and when run from cron.

Regards,
the current maintainer of Crypt-SSLeay

Write a response