Explicitly telling LWP::UserAgent where Crypt::SSLeay is

Explicitly telling LWP::UserAgent where Crypt::SSLeay is

am 20.09.2005 00:45:58 von aleccolvin

I had to change the first couple lines of Crypt::SSLeay to the
following so that it could find its .so file (I'm working in the user
directory of a webserver):

----------------------------------------

package Crypt::SSLeay;

use lib
"/hsphere/local/home/you_dont_need_to_see_this_one/cgi-bin/C rypt-SSLeay-0.51.tar/Crypt-SSLeay-0.51/blib/arch/auto/Crypt/ SSLeay";

use Crypt::SSLeay::X509;

----------------------------------------

How do I add the same change to LWP::UserAgent? I know that the above
change worked because it was enough to get the following script
working.

Thank you,
Alec Colvin

----------------------------------------

#!/usr/bin/perl -w

use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Crypt::SSLeay;
use LWP;

my $q = new CGI;

print $q->header(), $q->start_html();

print "

";
print "$Crypt::SSLeay::VERSION";
print "

";

print $q->end_html();

Re: Explicitly telling LWP::UserAgent where Crypt::SSLeay is

am 20.09.2005 07:01:18 von ced

aleccolvin@gmail.com wrote:
> I had to change the first couple lines of Crypt::SSLeay to the
> following so that it could find its .so file (I'm working in the user
> directory of a webserver):
>
> ----------------------------------------
>
> package Crypt::SSLeay;
>
> use lib
> "/hsphere/local/home/you_dont_need_to_see_this_one/cgi-bin/C rypt-SSLeay-0.51.tar/Crypt-SSLeay-0.51/blib/arch/auto/Crypt/ SSLeay";
>
> use Crypt::SSLeay::X509;
>
> ----------------------------------------
>
> How do I add the same change to LWP::UserAgent? I know that the above
> change worked because it was enough to get the following script
> working.
>
> Thank you,
> Alec Colvin
>
> ----------------------------------------
>
> #!/usr/bin/perl -w
>
> use strict;
> use CGI;
> use CGI::Carp qw(fatalsToBrowser);
> use Crypt::SSLeay;
> use LWP;
>
> my $q = new CGI;
>
> print $q->header(), $q->start_html();
>
> print "

";
> print "$Crypt::SSLeay::VERSION";
> print "

";
>
> print $q->end_html();

Have you already determined that LLWP doesn't work...?

The reason I ask is that LWP uses Crypt::SSLeay under the covers so
https requests should work transparently if Crypt::SSLeasy is usable.


--
Charles DeRykus

Re: Explicitly telling LWP::UserAgent where Crypt::SSLeay is

am 20.09.2005 08:19:19 von aleccolvin

It's a webserver. When I ran "perl Makefile.PL" for Crypt::SSLeay it
wasn't able to install Crypt::SSLeay in /usr/lib/perl5/site_perl/5.8.0/
because of the permissions. Thus, LWP::Protocol doesn't "know" about
Crypt::SSLeay, which is really the crux of my problem.

Re: Explicitly telling LWP::UserAgent where Crypt::SSLeay is

am 20.09.2005 19:25:28 von Scott W Gifford

aleccolvin@gmail.com writes:

> I had to change the first couple lines of Crypt::SSLeay to the
> following so that it could find its .so file (I'm working in the user
> directory of a webserver):

You should be able to take care of most of this automatically by
installing the module directly into some subdirectory of your home:

perl Makefile.PL PREFIX=/hsphere/local/home/you_dont_need_to_see_this_one/cgi -lib

Then put something like:

use lib '/hsphere/local/home/you_dont_need_to_see_this_one/cgi-lib/l ib/perl5'

at the top of scripts that use this module, or arrange for that path
to be added to the PERL5LIB environment variable.

This path might not be exactly right depending on your system, but it
should be easy enough to figure it out by looking at where the files
are installed.

After that, all modules used by that program will look in the right
directory, and so should find their libraries properly.

Good luck,

---Scott.

Re: Explicitly telling LWP::UserAgent where Crypt::SSLeay is

am 24.09.2005 06:30:33 von ced

aleccolvin@gmail.com wrote:
> It's a webserver. When I ran "perl Makefile.PL" for Crypt::SSLeay it
> wasn't able to install Crypt::SSLeay in /usr/lib/perl5/site_perl/5.8.0/
> because of the permissions. Thus, LWP::Protocol doesn't "know" about
> Crypt::SSLeay, which is really the crux of my problem.

Just a postscript to S.Gifford's answer, here's the doc how-to:

perldoc -q 'How do I keep my own module/library directory'

or perldoc -q module (scroll down to last question)

hth,
--
Charles DeRykus

Re: Explicitly telling LWP::UserAgent where Crypt::SSLeay is

am 29.09.2005 11:48:03 von Joe Smith

aleccolvin@gmail.com wrote:

> use lib
> "/hsphere/local/home/you_dont_need_to_see_this_one/cgi-bin/C rypt-SSLeay-0.51.tar/Crypt-SSLeay-0.51/blib/arch/auto/Crypt/ SSLeay";

You should never put libraries or data files under cgi-bin.
-Joe