LWP and HTTPS script not working via browser/CGI calls 
Author Message
 LWP and HTTPS script not working via browser/CGI calls

I am writing a Perl script that uses LWP to access SSL protected web
sites.  When run via command line, the script works flawlessly,
accessing the remote site and returning full content.   However, when
I run the same script via CGI (web browser), the content returned from
the remote site is blank ($res->content is empty).  It displays the
other print statements just fine, so I am lost.  The script must be
able to work via web browser, not command line, on SSL servers.  I am
new to LWP scripting.

Important:  The script works via browser fine when accessing standard
HTTP sites.  The problem is ONLY with HTTPS sites and ONLY via



use LWP;
use LWP::UserAgent;

print "Content-type: text/html\n\n"; # DO NOT REMOVE

$url = 'https://ce.verio.net/~dsproul/';
# $url = $url . '?zone=albyny01.us.ce.verio.net';

print "\n\nProcessing...\n\n";
print "URL BEING SENT:\n\"$url\"\n\n";

$ua = new LWP::UserAgent;
$req = new HTTP::Request GET => $url;

$req->authorization_basic('jgoldbloom', '*blotted*');

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

print "\n\nResponse from server: \n\n";
print $res->content;
print "\nEnd of Response!\nRun completed!\n";

Mon, 26 Jul 2004 04:31:46 GMT  
 [ 1 post ] 

 Relevant Pages 

1. work on command line and not via browser?

2. LWP::UserAgent - not found via web cgi

3. Alarm not working with network calls, LWP

4. LWP problem with HTTPS via proxy

5. LWP::UserAgent: https requests via http proxy

6. browser call opens text does not run perl script

7. New-2-Perl: Script output to Browser not working

8. Repost Script Works from Command Prompt but Not via Webserver

9. URL not working in Eudora via perl script

10. Scripts work from shell but not browser

11. My <!--#exec cgi="\scripts\script.pl"-->command will not work

12. Suggestion for a checklist when calling an external UNIX executable from CGI does not work


Powered by phpBB® Forum Software