Hola a tod@s,
Estoy encontrando problemas con mi script de perl cuando intento descargar algún fichero desde un servidor HTTPS externo.
Mi entorno es el siguiente:
- Sistema operativo: Suse Linux Enterprise Server 8
- Perl 5.8.0-58
- Libwww-perl 5.65-41
- Crypt-SSLeay 0.51
- Cron 3.0.1-649
Mi script de perl es tiene entre otras cosas:
/********************************************/
my $ua = LWP::UserAgent->new;
$ua->timeout(20);
# $ua->env_proxy;
$nombrefichero = shift(@ARGV);
my @URLS = ('
https://midominio/' . $nombrefichero);
my $response = $ua->get($laurl);
/********************************************/
El caso es que cuando ejecuto el script desde la consola del linux, el fichero se descarga sin ningún problema generando la siguiente traza:
/********************************************/
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET
https://midominio/mificheroLWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
SSL_connect:before/connect initialization
SSL_connect:SSLv3 write client hello A
SSL_connect:SSLv3 read server hello A
SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server key exchange A
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 write client key exchange A
SSL_connect:SSLv3 write change cipher spec A
SSL_connect:SSLv3 write finished A
SSL_connect:SSLv3 flush data
SSL_connect:SSLv3 read finished A
SSL_connect:SSL renegotiate ciphers
SSL_connect:SSLv3 write client hello A
SSL_connect:SSLv3 read server hello A
SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server key exchange A
SSL_connect:SSLv3 read server certificate request A
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 write client certificate A
SSL_connect:SSLv3 write client key exchange A
SSL_connect:SSLv3 write certificate verify A
SSL_connect:SSLv3 write change cipher spec A
SSL_connect:SSLv3 write finished A
SSL_connect:SSLv3 flush data
SSL_connect:SSLv3 read finished A
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 1000 bytes
LWP::UserAgent::request: Simple response: OK
/********************************************/
Pero si intento automatizar la tarea de descargar el fichero con el cron, cuando este lo ejecuta, obtengo la siguiente traza de error:
/********************************************/
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET
https://midominio/mificheroLWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::UserAgent::request: Simple response: Internal Server Error
/********************************************/
y el fichero no se descarga.
¿ Alguien tiene alguna idea ?, ¿ pueden ser las variables de entorno ?.
Muchas gracias.