1821983 Members
3316 Online
109638 Solutions
New Discussion юеВ

Net::SSLeay build fails

 
Ralph Grothe
Honored Contributor

Net::SSLeay build fails

Hello LWP users,

I need to have HTTPS support for LWP (aka libwww-perl).

Since I haven't had any SSL module installed so far and even lacked OpenSSL naturally there is no HTTPS support.

# perl -MLWP -e 'print LWP::UserAgent->new->is_protocol_supported("http"),"\n"'
1

# perl -MLWP -e 'print LWP::UserAgent->new->is_protocol_supported("https"),"\n"'
0


Therefore I built OpenSSL 0.9.6l from the source tarball with HP ANSI C exactly as suggested in the README of the Net_SSLeay.pm-1.25 tarball from the section for HP-UX that claims to have worked.
Here is the relevant excerpt from the README.SSL:


HPUX:
In principle the Unix build should work (Makefile.PL contains
special code to detect aCC), but historically there have been
some problems. Marko Asplund (aspa@@kronodoc._fi) reports
that he has successfully compiled on HP-UX. He used following
incantations

Configuring OpenSSL:

./Configure no-asm --prefix=/openssl/path hpux-parisc2-cc

Configuring Net::SSLeay:

perl Makefile.PL /openssl/path CCFLAGS='-D_HPUX_SOURCE \
-Aa -I/usr/local/include +e'

The magic bit seemed to be the `+e' flag. Since version 1.14
Makefile.PL tries to figure this out.

He was using: gcc v2.95.2, OpenSSL v0.9.6c, Net::SSLeay-1.13


The build and install of OpenSSL with the first invocation from above was successful.

However, when I run the "make test" after a build of Net::SSLeay as pointed out in the 2nd invocation I get error messages like this:

# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
1..20
/usr/lib/pa20_64/dld.sl: 'blib/arch/auto/Net/SSLeay/SSLeay.sl' is not a valid lo
ad module: Bad magic number
Can't load 'blib/arch/auto/Net/SSLeay/SSLeay.sl' for module Net::SSLeay: Invalid
argument at /opt/perl5/lib/5.8.0/PA-RISC2.0-LP64/DynaLoader.pm line 229.
at test.pl line 25
Compilation failed in require at test.pl line 25.
BEGIN failed--compilation aborted at test.pl line 25.
not ok 1
*** Error exit code 255


Now I hesitate to install the module.

Has anyone successfully installed HTTPS support for LWP?
Stop.


Madness, thy name is system administration
2 REPLIES 2
ranjith_2
New Member

Re: Net::SSLeay build fails

i have built on 32 bit perl. looks like you are using 64 bit perl.

looks like SSLeay.sl was not built correctly, can you check whether blib/arch/auto/Net/SSLeay/SSLeay.sl is 64 bit.
i just confirmed that when a 64 bit executable dlopen() a 32 bit library it gives out the same error as you reported.

if that is the problem you may have to add +DD64 option to the argument list of Makefile.PL.
Ralph Grothe
Honored Contributor

Re: Net::SSLeay build fails

Ranjith,

no it wasn't the 64bit issue.
What prevented me to build Perl's Net::SSLeay was the fact that I forgot to build the openssl libs as Position Independant Code (PIC).
I needed to add the +Z flag to the CFLAGS definition in the Makefile, and rebuilt openssl anew.
After that I could run all tests of Perl's Net::SSLeay and IO::Socket::SSL,
and LWP now is SSL/TLS ready and can handle HTTPS requests.
Madness, thy name is system administration