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.
AIX25Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

woolmilkporcCommented:
Strange.

Did you set LIBPATH?

echo $LIBPATH

If the variable is set unset it

unset LIBPATH

If it's not set, try setting it, making sure to have /opt/freeware/lib in the first position:

export LIBPATH=/opt/freeware/lib

and rerun /opt/freeware/bin/perl Makefile.PL

The issue could also be related to PATH

Try changing it temporarily:

export PATH=/opt/freeware/bin:$PATH

Again, rerun /opt/freeware/bin/perl Makefile.PL

Strange issue anyway, because /opt/freeware/bin/perl should always search in /opt/freeware first.
0
AIX25Author Commented:
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?
0
woolmilkporcCommented:
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"
0
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

AIX25Author Commented:
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
0
woolmilkporcCommented:
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?
0
AIX25Author Commented:
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>
0
AIX25Author Commented:
I ran this option and it worked.

rpm -e --nodeps openssl-0.9.8x-1
0
AIX25Author Commented:
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?
0
woolmilkporcCommented:
Do you now have an "openssl" binary in "/opt/freeware/bin"?


Sorry for the confusion, too!
I edited my answer after noticing my mistake. "--force" was wrong, I changed it to "--nodeps".
0
AIX25Author Commented:
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
0
woolmilkporcCommented:
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!
0
AIX25Author Commented:
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]
0
woolmilkporcCommented:
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' ;
0
AIX25Author Commented:
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.
0
woolmilkporcCommented:
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.
0
AIX25Author Commented:
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.
0
woolmilkporcCommented:
Sorry if you misunderstood me.

The lines I mentioned are in Makefile.PL, not in the resulting Makefile!
0
AIX25Author Commented:
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>
0
woolmilkporcCommented:
I found a hint in the README:

OPENSSL_PREFIX=/opt/freeware /opt/freeware/bin/perl Makefile.PL

Obviously the variable OPENSSL_PREFIX is honored by the Makefile, although I can't find any trace in that file.

I tried it and it works. I see this:

*** Found OpenSSL-1.0.1c installed in /opt/freeware

wmp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AIX25Author Commented:
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?
0
woolmilkporcCommented:
Try it, if they fail they won't do any harm.
0
AIX25Author Commented:
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?
0
woolmilkporcCommented:
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.
0
AIX25Author Commented:
Yes, my "make" was fine...so I ran the "make install" ok. Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.