http://qs1969.pair.com?node_id=287329


in reply to Odd effects of mod_perl on IO::Socket or LWP::Protocol?

One possibility: the module Net::HTTPS, used by LWP::Protocol::https::Socket, uses one of IO::Socket::SSL or Net::SSL.

It chooses by looking to see if $IO::Socket::SSL::VERSION is defined (ie the module's already loaded) and uses that if so.

If not, it first tries Net::SSL, then IO::Socket::SSL only if that can't be loaded.

Outside of mod_perl, you'll get Net::SSL. Inside of mod_perl, if you are using IO::Socket::SSL elsewhere (and I know we are, since I know the code in question ;), you'll get it instead.

This happened to me once before, but at the time I didn't have the ambition to find out _why_ it didn't work when IO::Socket::SSL was used by the module. I just hacked around it (set $IO::Socket::SSL::VERSION to undef just long enough to fool it into using Net::SSL) and went on my way.

- Matt Riffle
  Sr. Systems Programmer, pair Networks, Inc.
  (although, I speak only for myself; code is untested unless otherwise stated)

  • Comment on Re: Odd effects of mod_perl on IO::Socket or LWP::Protocol?

Replies are listed 'Best First'.
Re: Re: Odd effects of mod_perl on IO::Socket or LWP::Protocol?
by ehdonhon (Curate) on Aug 28, 2003 at 17:46 UTC
    One possibility: the module Net::HTTPS, used by LWP::Protocol::https::Socket, uses one of IO::Socket::SSL or Net::SSL

    Yes, that was exactly it, thanks!

    (set $IO::Socket::SSL::VERSION to undef just long enough to fool it into using Net::SSL)

    .. And that solution worked for me here as well. :)

    It would be nice to know why Net::SSL works but IO::Socket::SSL doesn't. But that is a problem for another day.