Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by mattriff (Chaplain)
on Aug 28, 2003 at 12:23 UTC ( #287329=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://287329]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2023-06-03 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (16 votes). Check out past polls.

    Notices?