http://qs321.pair.com?node_id=1226416

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

I like to try out TLS 1.3. Unfortunately, as these things go, my Ubuntu 18.04 LTS comes only with the last OpenSSL version that doesn't support the new TLS version.

I'm a bit bamboozled on how to get Net::SSLeay working with my custom version.

I built the latest OpenSSL (1.1.1a) and installed it in my user home:

$ tar xvzf openssl-1.1.1a.tar.gz $ cd openssl-1.1.1a/ $ ./config --prefix=/home/cavac/bin/openssl $ make -j24 $ make test $ make install

So far, it all worked out nicely. But i can't get Net::SSLeay to build:

$ cpan cpan shell -- CPAN exploration and modules installation (v2.20) Enter 'h' for help. cpan[1]> look Net::SSLeay + + + Database was generated on Tue, 27 Nov 2018 12:17:03 GMT Running look for module 'Net::SSLeay' Trying to open a subshell in the build directory... Checksum for /home/cavac/.cpan/sources/authors/id/M/MI/MIKEM/Net-SSLea +y-1.85.tar.gz ok Working directory is /home/cavac/.cpan/build/Net-SSLeay-1.85-2 cavac@cables:~/.cpan/build/Net-SSLeay-1.85-2$ OPENSSL_PREFIX=/home/cav +ac/bin/openssl perl Makefile.PL /home/cavac/bin/openssl/bin/openssl: /usr/lib/x86_64-linux-gnu/libssl. +so.1.1: version `OPENSSL_1_1_1' not found (required by /home/cavac/bi +n/openssl/bin/openssl) /home/cavac/bin/openssl/bin/openssl: /usr/lib/x86_64-linux-gnu/libcryp +to.so.1.1: version `OPENSSL_1_1_1' not found (required by /home/cavac +/bin/openssl/bin/openssl) *** OpenSSL version test failed (`' has been returned) Either you have bogus OpenSSL or a new version has changed the ver +sion number format. Please inform the authors!

Do i need to set some extra LD_LIBRARY_PATH or something? What about during runtime of my scripts, do i also need to set the environment variables or does Net::SSLeay remember?

I certainly want to make sure that only my local (self compiled) version of Perl uses this version of OpenSSL. I don't want to break other programs installed on the system.

perl -e 'use MIME::Base64; print decode_base64("4pmsIE5ldmVyIGdvbm5hIGdpdmUgeW91IHVwCiAgTmV2ZXIgZ29ubmEgbGV0IHlvdSBkb3duLi4uIOKZqwo=");'

Replies are listed 'Best First'.
Re: Net::SSLeay on Ubuntu 18.04 with custom OpenSSL version
by marto (Cardinal) on Nov 27, 2018 at 14:31 UTC

      To be honest, no i didn't. But as far as i can determine, i'm not getting far enough in the build process for those bugs to become relevant.

      I'm was failing at some very basic level for which i should have known (and tested) the solution after using Linux for 20 years:

      $ OPENSSL_PREFIX=/home/cavac/bin/openssl LD_LIBRARY_PATH=/home/cavac/b +in/openssl/lib:$LD_LIBRARY_PATH perl Makefile.PL *** Found OpenSSL-1.1.1a installed in /home/cavac/bin/openssl *** That's newer than what this module was tested with You should consider checking if there is a newer release of this m +odule available. Everything will probably work OK, though. *** Be sure to use the same compiler and options to compile your OpenS +SL, perl, and Net::SSLeay. Mixing and matching compilers is not supported. Do you want to run external tests?

      So, LD_LIBRARY_PATH did the trick. Not sure why Net::SSLeay doesn't set it automatically, though...

      And now i have to look into testing with the Github version of Net::SSLeay, since the bugs are marked "patched".

      perl -e 'use MIME::Base64; print decode_base64("4pmsIE5ldmVyIGdvbm5hIGdpdmUgeW91IHVwCiAgTmV2ZXIgZ29ubmEgbGV0IHlvdSBkb3duLi4uIOKZqwo=");'

        If I get time to spare this evening I'll dig into this some more.