Crypt::SSLeay and Ubuntu 11.10

Update 2: If you’re seeing this error, grab the new version of Crypt::SSLeay, version 0.60 has been released which should solve this version. For more details see the blog post announcing it’s release.

If you need to install Crypt::SSLeay on Ubuntu 11.10 and it fails with errors complaining it can’t load it might be RT 70565 hasn’t been patched yet.

#     Tried to use 'Net::SSL'.
#     Error:  Can't load '/home/user/.cpanm/work/1319487963.639/Crypt-SSLeay-0.58/blib/arch/auto/Crypt/SSLeay/' for module Crypt::SSLeay: /home/user/.cpanm/work/1319487963.639/Crypt-SSLeay-0.58/blib/arch/auto/Crypt/SSLeay/ undefined symbol: SSLv2_client_method at /home/user/perl5/perlbrew/perls/perl-5.14.1/lib/5.14.1/x86_64-linux/ line 190.

Luckily there is a patch attached to the case, nossl2.patch which can be applied to make it just work.

If you’re using cpanm, run it in prompt mode and look at the errors when they occur. That will allow you to patch the module and get it working again.

$ cpanm Crypt::SSLeay --prompt
--> Working on Crypt::SSLeay
Fetching ... OK
Configuring Crypt-SSLeay-0.58 ... OK
Building and testing Crypt-SSLeay-0.58 ... FAIL
Testing Crypt-SSLeay-0.58 failed.
You can s)kip, r)etry, f)orce install or l)ook ? [s] l
Entering /home/user/.cpanm/work/1319488454.2107/Crypt-SSLeay-0.58 with /bin/bash
$ patch < ~/Downloads/nossl2.patch
patching file SSLeay.xs
$ make
$ make test
$ exit
You can s)kip, r)etry, f)orce install or l)ook ? [s] r
Successfully installed Crypt-SSLeay-0.58

The failures aren’t really any ones fault, it’s simply that things move on. I’m assuming the module will be patched soon and this blog post will become redundant. Until then hopefully this helps people find the RT case with the solution.

Update: Torsten Raudssus has just pointed out that there is a development version that appears to fix the problem. Check the CPAN page to see if it’s still the latest, but assuming it is install it like this. Note that when it’s released, it will probably be version 0.59. The _nn part gets dropped when it’s released.

cpanm NANIS/Crypt-SSLeay-0.59_03.tar.gz

Once the developer is happy with the patch and has released it, you should be able to go back to simply installing it with cpanm Crypt::SSLeay as usual. The development release means that until it is ready for the prime time, that installing the module without specifying the version number will pick up the previous release, 0.58. I’ll try to update this post again when I notice that it has been released.


Searching stackexchange

It’s funny but I just realised the best way to search the stackexchange sites (stackoverflow, askubuntu etc.) is to type in a question. As you type in a title, and then the actual question it tries to suggest relevant questions. It’s always been a good feature, but I finally realised it’s actually a lot better than simply using the search button in the conventional way. I assume it must be because you type in a lot more detail when you formulate a proper question so it must have a lot more keywords it can use to do a better search for you.

The more I use those sites, the more I realise they have a lot of intelligent ideas demonstrated.