Stupid Perl/Apache Question

Thomas Charron twaffle at gmail.com
Thu Dec 7 16:40:06 EST 2006


  Make sure you have IO::Socket:SSL installed as well.  It could also be a
socket that was closed prematurely.

On 12/7/06, Brian Chabot <brian at datasquire.net> wrote:
>
> I'm trying to use a perl script to scrape a site under https.
>
> Using perl-WWW-Mechanize-1.20-1mdv2007.0 from RPM.
> perl-Apache-Test-1.28-2mdv2007.0
> apache-base-2.2.3-1mdv2007.0
> apache-mod_perl-2.0.2-8mdv2007.0
>
> The script parses fine till it goes to scrape the page...
>
> The line that's failing is:
>
>         $mech->get( $URL );
>
> ...where $URL is an HTTPS address with basic auth.  I tried using
>
> $auth = MIME::Base64::encode("$adminuser:$adminpass") || die "Error:
> $!\n";
> $mech->add_header (Authorization=>"Basic $auth") || die "Error: $!\n";
>
> and
>
> my @args = (
>      Authorization => "Basic " .
>            MIME::Base64::encode( $adminuser . ':' . $adminpass )
> );
>
> and even putting the username and password in the URL.
>
> I have IO::Socket::SSL and Crypt::SSLeay both loaded.
>
> Yet I keep seeing this error when I run the script from the browser:
> Error GETing https://path/to/me/called/script: Can't connect to
> host.domain.tld:443 (Illegal seek) at /var/www/cgi-bin/myscript.cgi line
> 168, referer: http://host.domain.tld/cgi-bin/myscript.cgi
>
> Line 168 is simply:
>
>         $mech->get( $URL, @args );
>
>
> or
>
>         $mech->get( $URL );
>
>
> It worked on another machine just fine... but that other machine is dead.
>
> Anyone see anything I might be doing wrong here?  The documentation for
> Mechanize could be a lot better.
>
>
> Thanks!
>
> Brian
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>



-- 
-- Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20061207/cecdd73a/attachment.html


More information about the gnhlug-discuss mailing list