Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: IO::Socket::SSL incompatibility with WWW::Mechanize

by runrig (Abbot)
on Jul 11, 2013 at 19:59 UTC ( #1043817=note: print w/replies, xml ) Need Help??

in reply to IO::Socket::SSL incompatibility with WWW::Mechanize

Mechanize works as expected if either IO::SOCKET::SSL or NET::SSLeay is not installed.

That makes sense, somewhat, because IO::Socket::SSL requires Net::SSLeay (so you should not be able to install or use the first without the second anyway). Net::HTTPS prefers IO::Socket::SSL over Net::SSL, so if IO::Socket::SSL is completely installed (i.e., with Net::SSLeay), then it will use that library. Otherwise it will use Net::SSL, and that is what is happening if you only have one of those two modules you mention installed.

Make sure you have the latest version of Net-HTTP because there have been issues with that library when used in combination with IO::Socket::SSL. You can also set $Net::HTTPS::SSL_SOCKET_CLASS or environment variable PERL_NET_HTTPS_SSL_SOCKET_CLASS to 'Net::SSL' to explicitly use that library instead of the other.

  • Comment on Re: IO::Socket::SSL incompatibility with WWW::Mechanize

Replies are listed 'Best First'.
Re^2: IO::Socket::SSL incompatibility with WWW::Mechanize
by Madhuk (Initiate) on Jul 11, 2013 at 23:22 UTC

    Setting the $Net::HTTPS::SSL_SOCKET_CLASS to 'Net::SSL' helped. Both POP3Client and Mechanize are working as expected now.

    Included the below code in the beginning of the script.

    use Net::SSL (); $Net::HTTPS::SSL_SOCKET_CLASS = "Net::SSL";

    Thank you for the help!


      Do you have the latest Net-HTTP installed? I'm guessing no, because then I think you would have to set environment variable PERL_LWP_SSL_VERIFY_HOSTNAME to 0.

        No, I don't have Net-HTTP installed. That's good to know.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043817]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2018-06-19 07:18 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (111 votes). Check out past polls.