ecuguru has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to run LWP::simple to do a https Get. I force installed Net::SSLeay (it wouldn't install without Force) through CPAN. I get an error about a dynamic image while running the https code:
dyld: perl Undefined symbols: /Library/Perl/5.8.1/darwin-thread-multi-2level/auto/Crypt/SSLeay/SSLeay.bundle undefined reference to _OpenSSL_add_all_algorithms expected to be defined in a dynamic image Trace/BPT trap
I have no idea what this means. I am working off the Readme.SSL from the docs. Google turned up nothing of the above. Any help appreciated. This is my code:
use LWP::Simple; my $url = 'https://www.site.com/cgi-bin/ip.pl'; my $content = get $url; die "Couldn't get $url" unless defined $content; print $content;

Replies are listed 'Best First'.
Re: https on OSX 10.3 crypto failure
by fokat (Deacon) on Jan 02, 2004 at 12:47 UTC

    Dear ecuguru:

    Without more context, your question is at best, hard to answer. You fail to state why do you need to force the installation of Net::SSLeay. This, along with the description of the error you provide, makes me think you need to install the correct version of the OpenSSL library, or tell Net::SSLeay where to find it.

    The following, is what I can find in my system (Mac OS X 10.3):

    maclem:~ lem$ find /usr/lib -name *ssl*
    /usr/lib/libssl.0.9.7.dylib
    /usr/lib/libssl.0.9.dylib
    /usr/lib/libssl.dylib
    /usr/lib/pkgconfig/openssl.pc
    

    No significant hits appear at Mac-specific library directories. I also tried this:

    maclem:~ lem$ egrep -i add_all_algorithms /usr/lib/*ssl*
    maclem:~ lem$ egrep -i add_all_algorithms /usr/lib/pkgconfig/*ssl*
    

    Which means the method you cite as missing, is not included in any of my system's libraries, which as seen below, are OpenSSL:

    maclem:~ lem$ strings /usr/lib/libssl.0.9.7.dylib | egrep OpenSSL
    SSLv2 part of OpenSSL 0.9.7b 10 Apr 2003
    SSLv3 part of OpenSSL 0.9.7b 10 Apr 2003
    SSLv2/3 compatibility part of OpenSSL 0.9.7b 10 Apr 2003
    TLSv1 part of OpenSSL 0.9.7b 10 Apr 2003
    OpenSSL 0.9.7b 10 Apr 2003
    

    You can use fink to install packages openssl-* and then, attempt to build Net::SSLeay. You probably should install openssl and openssl-dev. Feel free to message me about fink, as that is too non-Perl related to add here.

    Update: I just went ahead and installed Net::SSLeay on my system, using the following sequence of commands:

    sudo perl -MCPAN -e shell
    look Net::SSLeay
    perl Makefile.PL -t
    make install
    

    The tests included with the distribution passed, so my suggestion would be to re-attempt the Net::SSLeay installation and capture the errors, so that we can take a look at them...

    Best regards

    -lem, but some call me fokat

Re: https on OSX 10.3 crypto failure
by Anonymous Monk on Jan 02, 2004 at 13:15 UTC
    I'll provide you as much info as I can.. Please excuse my lack of info as ignorance and not indifference.. I'm still a perl newbie. We match in some areas, but not others..
    [ninja2:~/code/perl] guru% strings /usr/lib/libssl.0.9.7.dylib | egrep + OpenSSL SSLv2 part of OpenSSL 0.9.7b 10 Apr 2003 SSLv3 part of OpenSSL 0.9.7b 10 Apr 2003 SSLv2/3 compatibility part of OpenSSL 0.9.7b 10 Apr 2003 TLSv1 part of OpenSSL 0.9.7b 10 Apr 2003 OpenSSL 0.9.7b 10 Apr 2003 <br> [ninja2:~/code/perl] guru% grep -i add_all_algorithms /usr/lib/*ssl* [ninja2:~/code/perl] guru% find /usr/lib -name *ssl* tcsh: find: No match. <br>
    I uninstalled my Crypt module, and went to Cpan to reinstall. I get this during the install:
    <br> /usr/local/lib does not seem to contain the SSLeay library files Found the following OpenSSL installations: OpenSSL 0.9.6 /usr/local/ssl OpenSSL 0.9.6 /usr/local OpenSSL 0.9.7 /usr Which OpenSSL build path do you want to link against? [/usr/local/ssl]

    I chose /usr/local/ssl, and then get the following at the end of the script.
    /Users/guru/.cpan/build/Crypt-SSLeay-0.51/blib/arch/auto/Crypt/SSLeay/ +SSLeay.bundle undefined reference to _OpenSSL_add_all_algorithms expe +cted to be defined in a dynamic image t/net_ssl........dubious + Test returned status 0 (wstat 5, 0x5) t/ssl_context....dyld: /usr/bin/perl Undefined symbols: /Users/guru/.cpan/build/Crypt-SSLeay-0.51/blib/arch/auto/Crypt/SSLeay/ +SSLeay.bundle undefined reference to _OpenSSL_add_all_algorithms expe +cted to be defined in a dynamic image t/ssl_context....dubious + Test returned status 0 (wstat 5, 0x5) FAILED--2 test scripts could be run, alas--no output ever seen make: *** [test_dynamic] Error 2 /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force
    Then, if I rerun with Force, it claims to install cleanly. But I get the error I presented earlier in the code. Ask me for any information and I'll provide it.
    Also, I came across this website, but can't tell if it means anything.. many many thanks.. tim
      That worked!! The Library! Maybe that was it.. I did: sudo cpan then cpan> install Crypt::SSLeay
      the Encryption.SSL text document included only says Crypt.SSLeay, not Net::SSLeay. I guess I should have known that?
      Anyhow, perhaps that was the problem, I was going after the wrong library?
      Your method of installing the module, being the lamer newbie I am I haven't seen it before, but it appears to be similar to what Cpan does. Is that a correct assumption, and is your way a better way to install modules?
      Thank you, So much!
      Tim
        That worked!!

        I'm glad it worked for you. I see that your install is looking for OpenSSL under /usr/local/lib. Perhaps you could succeed by telling the installer to look under /usr/lib instead.

        The look command from the CPAN module, allows you to manually look into a distribution. It is useful for complex installations. Indeed, I wanted to take a look at Net::SSLeay since I've never installed it and I assumed you followed the standard recipe. 99% of the time, you can issue the more standard install command.

        Best regards

        -lem, but some call me fokat