Using Perl PayPal API on Debian wheezy

Monday 7 October 2013 by Bradley M. Kuhn

I recently upgraded to Debian wheezy. On, Debian squeeze, I had no problem using the stock Perl module Business::PayPal::API to import PayPal transactions for Software Freedom Conservancy, via the Debian package libbusiness-paypal-api-perl.

After the wheezy upgrade, something goes wrong and it doesn't work. I reviewed some similar complaints, that seem to relate to this resolved bug, but that wasn't my problem, I don't think.

I ran strace to dig around and see what was going on. The working squeeeze install did this:

            select(8, [3], [3], NULL, {0, 0})       = 1 (out [3], left {0, 0})
            write(3, "SOMEDATA"..., 1365) = 1365
            rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
            rt_sigaction(SIGALRM, {SIG_DFL, [], 0}, {SIG_DFL, [], 0}, 8) = 0
            rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
            rt_sigprocmask(SIG_BLOCK, [ALRM], [], 8) = 0
            rt_sigaction(SIGALRM, {0xxxxxx, [], 0}, {SIG_DFL, [], 0}, 8) = 0
            rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
            alarm(60)                               = 0
            read(3, "SOMEDATA", 5)               = 5
            

But the same script on wheezy did this at the same point:

            select(8, [3], [3], NULL, {0, 0})       = 1 (out [3], left {0, 0})
            write(3, "SOMEDATA"..., 1373) = 1373
            read(3, 0xxxxxxxx, 5)                   = -1 EAGAIN (Resource temporarily unavailable)
            select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout)
            read(3, 0xxxxxxxx, 5)                   = -1 EAGAIN (Resource temporarily unavailable)
            select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout)
            read(3, 0xxxxxxxx, 5)                   = -1 EAGAIN (Resource temporarily unavailable)
            select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout)
            read(3, 0xxxxxxxx, 5)                   = -1 EAGAIN (Resource temporarily unavailable)
            

I was pretty confused, and basically I still am, but then I noticed this in the documentation for Business::PayPal::API, regarding SOAP::Lite:

if you have already loaded Net::SSLeay (or IO::Socket::SSL), then Net::HTTPS will prefer to use IO::Socket::SSL. I don't know how to get SOAP::Lite to work with IO::Socket::SSL (e.g., Crypt::SSLeay uses HTTPS_* environment variables), so until then, you can use this hack: local $IO::Socket::SSL::VERSION = undef;

That hack didn't work, but I did confirm via strace that on wheezy, IO::Socket::SSL was getting loaded instead of Net::SSL. So, I did this, which was a complete and much worse hack:

            use Net::SSL;
            use Net::SSLeay;
            $ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;
            # Then:
            use Business::PayPal::API qw(GetTransactionDetails TransactionSearch);
            

… And this incantation worked. This isn't the right fix, but I figured I should publish this, as this ate up three hours, and it's worth the 15 minutes to write this post, just in case someone else tries to use Business::PayPal::API on wheezy.

I used to be a Perl expert once upon a time. This situation convinced me that I'm not. In the old days, I would've actually figured out what was wrong.

Posted on Monday 7 October 2013 at 19:00 by Bradley M. Kuhn.

Comment on this post in this identi.ca conversation.



Creative Commons License This website and all documents on it are licensed under a Creative Commons Attribution-Share Alike 3.0 United States License .


#include <std/disclaimer.h>
use Standard::Disclaimer;
from standard import disclaimer
SELECT full_text FROM standard WHERE type = 'disclaimer';

Both previously and presently, I have been employed by and/or done work for various organizations that also have views on Free, Libre, and Open Source Software. As should be blatantly obvious, this is my website, not theirs, so please do not assume views and opinions here belong to any such organization. Since I do co-own ebb.org with my wife, it may not be so obvious that these aren't her views and opinions, either.

— bkuhn


ebb ® is a registered service mark of Bradley M. Kuhn.

Bradley M. Kuhn <bkuhn@ebb.org>