Link to home
Start Free TrialLog in
Avatar of AIX25
AIX25Flag for United States of America

asked on

AIX - Perl module for Net::SSLeay

I'm getting SSLeay module is not loading correctly.  SSLeay is needed by libSSL, which is needed to make secure (encrypted) connection to the LDAP server.

server:/> /opt/freeware/bin/perl test.pl

Can't load '/opt/freeware/lib/perl5/site_perl/5.8.8/ppc-thread-multi/auto/Net/SSLeay/SSLeay.so' for module Net::SSLeay:         0509-130 Symbol resolution failed for /opt/freeware/lib/libssl.so because:

        0509-136   Symbol EC_POINT_oct2point (number 33) is not exported from
                   dependent module /usr/lib/libcrypto.a(libcrypto.so.0.9.8).
        0509-136   Symbol EC_POINT_point2oct (number 34) is not exported from
                   dependent module /usr/lib/libcrypto.a(libcrypto.so.0.9.8).
        0509-136   Symbol EC_POINT_copy (number 35) is not exported from
                   dependent module /usr/lib/libcrypto.a(libcrypto.so.0.9.8).
        0509-136   Symbol EC_POINT_free (number 36) is not exported from
                   dependent module /usr/lib/libcrypto.a(libcrypto.so.0.9.8).
        0509-136   Symbol EC_POINT_new (number 37) is not exported from
                   dependent module /usr/lib/libcrypto.a(libcrypto.so.0.9.8).
        0509-136   Symbol EC_GROUP_get_degree (number 38) is not exported from
                   dependent module /usr/lib/libcrypto.a(libcrypto.so.0.9.8).
        0509-021 Additional errors occurred but are not reported.
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command. at /opt/freeware/lib/perl5/5.8.8/ppc-thread-   multi/DynaLoader.pm line 227, <DATA> line 749.
at /opt/freeware/lib/perl5/site_perl/5.8.8/IO/Socket/SSL.pm line 17

Compilation failed in require at /opt/freeware/lib/perl5/site_perl/5.8.8/IO/Socket/SSL.pm line 17, <DATA> line 749.
BEGIN failed--compilation aborted at /opt/freeware/lib/perl5/site_perl/5.8.8/IO/Socket/SSL.pm line 17, <DATA> line 749.
Compilation failed in require at /opt/freeware/lib/perl5/site_perl/5.8.8/Net/LDAP.pm line 184, <DATA> line 749.

server:/> rpm -qa |grep ssl
openssl-0.9.8x-1

server:/> :/opt/freeware/bin> ls -ld ssl*
lrwxrwxrwx    1 root     system           25 Jun 22 19:41 ssleay -> /opt/freeware/bin/openssl

server:/opt/freeware/bin> cd /opt/freeware/bin/openssl
ksh: /opt/freeware/bin/openssl: 0403-037 The specified path name is not a directory.

server:/tmp/perl_mod/Net-SSLeay-1.55> /opt/freeware/bin/perl Makefile.PL
*** Found OpenSSL-0.9.8y installed in /usr
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n]

As you can see from my rpm output...I have openssl installed. What should I do to get this to see my rpm SSL verision? When I go to install NET::SSLeay it gives me the compiler erro.
SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AIX25

ASKER

two things...I don't see openssl in /opt/freeware/bin or /opt/freeware/lib and The export LIBPATH is not working.

server:/opt/freeware/bin> ls -ld *ssl*
lrwxrwxrwx    1 root     system           25 Jun 22 19:41 ssleay -> /opt/freeware/bin/openssl
server:/opt/freeware/bin> cd /opt/freeware/bin/openssl
ksh: /opt/freeware/bin/openssl:  not found.
server:/opt/freeware/bin> cd ../lib
server:/opt/freeware/lib> ls -ld *ssl*
-rw-r--r--    1 root     system      1934598 May 11 2012  libssl.a
lrwxrwxrwx    1 root     system           15 Jun 22 19:45 libssl.so -> libssl.so.0.9.8
-rw-r--r--    1 root     system       362538 May 11 2012  libssl.so.0.9.7
-rwxr-xr-x    1 root     system       507145 May 11 2012  libssl.so.0.9.8
server:/opt/freeware/lib>

server:/> export LIBPATH=/opt/freeware/lib
server:/> echo #LIBPATH

server:/>

Should I uninstall openssl rpm and reinstall? What is my LIBPATH not exporting?
1) The "openssl" binary should  exist in /opt/freeware/bin.
/opt/freeware/bin/openssl is a file, not a directory, by the way.

The fact that it's missing might be the reason for your issue, because perl then only finds the lpp version named /usr/bin/openssl.

So you should indeed uninstall and reinstall openssl.

2) echo #LIBPATH
won't work, that's true. It's "echo $LIBPATH"
Avatar of AIX25

ASKER

The hash was a typo :).

Is there a way to remove just openssl?

server:/opt/freeware/bin> rpm -e openssl-0.9.8x-1
error: removing these packages would break dependencies:
        openssl >= 0.9.8 is needed by openldap-2.4.23-0.3
        openssl >= 0.9.8 is needed by httpd-2.2.23-1
        openssl >= 0.9.8 is needed by mod_ssl-2.2.23-1
        openssl >= 0.9.8 is needed by libssh2-1.4.2-2
        openssl >= 0.9.8 is needed by curl-7.27.0-1
        openssl >= 0.9.8 is needed by mod_php_ap22-5.4.7-1
        openssl >= 0.9.8 is needed by php-cli-5.4.7-1
        libcrypto.so is needed by httpd-2.2.23-1
        libcrypto.so is needed by mod_ssl-2.2.23-1
        libcrypto.so is needed by mod_php_ap22-5.4.7-1
        libcrypto.so is needed by php-cli-5.4.7-1
        libssl.so is needed by httpd-2.2.23-1
        libssl.so is needed by mod_ssl-2.2.23-1
        libssl.so is needed by mod_php_ap22-5.4.7-1
        libssl.so is needed by php-cli-5.4.7-1
rpm -e --nodeps ...

The hash was a typo :). A typo here at EE or at the shell prompt?

You're not going to tell me that "echo $LIBPATH" gave no output after issuing "export LIBPATH=/opt/freeware/lib", are you?
Avatar of AIX25

ASKER

At the prompt.

The "echo $LIBPATH" worked fine. Sorry for the confusion.

Now I get this. Is there around this?
server:/opt/freeware/bin> rpm -e --force openssl-0.9.8x-1
rpm: only installation, upgrading, rmsource and rmspec may be forced
server:/opt/freeware/bin>
Avatar of AIX25

ASKER

I ran this option and it worked.

rpm -e --nodeps openssl-0.9.8x-1
Avatar of AIX25

ASKER

I ran the path exports you provide and its still looking under /usr for SSL

server:/tmp/perl_mod/Net-SSLeay-1.55> echo $LIBPATH
/opt/freeware/lib

server:/tmp/perl_mod/Net-SSLeay-1.55> echo $PATH
/opt/freeware/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/opt/ifor/ls/os/aix/bin

server:/tmp/perl_mod/Net-SSLeay-1.55> /opt/freeware/bin/perl Makefile.PL
*** Found OpenSSL-0.9.8y installed in /usr
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n]

Any ideas on what to try?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AIX25

ASKER

Yes, openssl binary is there:

server:/> ls -l /opt/freeware/bin/*ssl*
-rwxr-xr-x    1 root     system       423737 May 11 2012  /opt/freeware/bin/openssl
lrwxrwxrwx    1 root     system           25 Aug 30 10:58 /opt/freeware/bin/ssleay -> /opt/freeware/bin/openssl
I just looked at the Makefile.PL.

Unlike other Makefiles it contains "#!/usr/bin/perl" in the first line, which would force using AIX perl.

I think you should edit Makefile.PL to remove that first line and retry!
Avatar of AIX25

ASKER

server:/tmp/perl_mod/Net-SSLeay-1.55> grep freeware Makefile.PL
#!/opt/freeware/bin/perl

server:/tmp/perl_mod/Net-SSLeay-1.55> /opt/freeware/bin/perl Makefile.PL
*** Found OpenSSL-0.9.8y installed in /usr
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n]
I'm running out of ideas ...

You could try

/opt/freeware/bin/perl  Makefile.PL  --   PREFIX=/opt/freeware/lib/perl5

Note that "--" is a flag of its own (i.e. there are spaces around it).

Further, I found these lines in the Makefile

# It seems at least Redhat installs OpenSSL in /usr ...
$openssl_path = '/usr' if -x '/usr/bin/openssl' || -x '/usr/sbin/openssl';
$openssl_path = '/opt/ssl' if -x '/opt/ssl/bin/openssl'
    || -x '/opt/ssl/sbin/openssl';
$openssl_path = '/usr/local/ssl' if -x '/usr/local/ssl/bin/openssl';


You could try changing the first one starting with "$openssl_path = '/usr' if -x ' ..."

to

$openssl_path = '/opt/freeware' if -x '/opt/freeware/bin/openssl' ;
Avatar of AIX25

ASKER

How do I uninstall a module? I thinkg I installed Net::SSLeay in the past and ignored all errors. A clean re-install might help.
Did you read the second part of my last comment? I think changing that part of the Makefile looks promising.

Deinstalling a CPAN module is not quite trivial.

You could install CPANPLUS, a command shell for CPAN.

http://search.cpan.org/~bingos/CPANPLUS-0.9142/lib/CPANPLUS.pm

Start it with "cpanp". There is a "u" subcommand for uninstalling. "cpanp -h" gives help info.
Avatar of AIX25

ASKER

I did read the second part. I scanned my Makefile and could not find those strings. Also, I'm working on a DMZ server, which has tons of firewall rules in place, and blocks my access to the cpan network.
Sorry if you misunderstood me.

The lines I mentioned are in Makefile.PL, not in the resulting Makefile!
Avatar of AIX25

ASKER

I knew that you mean Makefile.PL. Here is my output below of the file. Not much in it.

server:/tmp/perl_mod/Net-SSLeay-1.55> cat Makefile.PL
#!/opt/freeware/bin/perl

use strict;
use warnings;
use lib 'ext';
use inc::Module::Install;
use Config;
use File::Spec;

name('Net-SSLeay');
license('SSLeay');
all_from('lib/Net/SSLeay.pm');

ssleay();

requires('MIME::Base64');
requires('Test::More' => '0.60_01');

clean_files(map { fixpath($_) } qw(
    makecert.out
    makecert.err
    sslecho.log
    tcpecho.log
    t/local/ptr_cast_test
    examples/cert.pem
    examples/key.pem
    examples/key.pem.e
    examples/*.0
));

no_index( directory => qw( inc ext helper_script examples ) );
resources( repository => 'http://svn.debian.org/wsvn/net-ssleay' );
resources( bugtracker => 'https://rt.cpan.org/Public/Dist/Display.html?Name=net-ssleay' );

my $regen_script = File::Spec->catfile('helper_script', 'regen_openssl_constants.pl');
my $constants_t = File::Spec->catfile('t', 'local', '21_constants.t');

postamble <<"MAKE";
constants.c : $regen_script
        \$(ABSPERLRUN) $regen_script -gen-c constants.c

$constants_t : $regen_script
        \$(ABSPERLRUN) $regen_script -gen-t $constants_t

SSLeay$Config{'obj_ext'} : constants.c $constants_t

MAKE

WriteAll();
server:/tmp/perl_mod/Net-SSLeay-1.55>
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AIX25

ASKER

You are truly a guru!

server:/tmp/perl_mod/Net-SSLeay-1.55> OPENSSL_PREFIX=/opt/freeware /opt/freeware/bin/perl Makefile.PL
*** Found OpenSSL-0.9.8x installed in /opt/freeware
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n]

The server I'm working on is a DMZ server with alot of rules in place. So, should I run the external test?
Try it, if they fail they won't do any harm.
Avatar of AIX25

ASKER

Here is the bottom portion of my "make test"

8 tests and 265 subtests skipped.
Failed 3/31 test scripts. 17/1871 subtests failed.
Files=31, Tests=1871, 12 wallclock secs (10.89 cusr +  1.50 csys = 12.39 CPU)
Failed 3/31 test programs. 17/1871 subtests failed.
make: 1254-004 The error code from the last command is 255.


Stop.
server:/tmp/perl_mod/Net-SSLeay-1.55

Ok to run make install?
If "make" (not "make test") ran without errors it seems quite OK to run "make install".

Failure of 3/31 tests can have many reasons, and after all just 17 of 1871 subtests failed.
Avatar of AIX25

ASKER

Yes, my "make" was fine...so I ran the "make install" ok. Thank you!