SpacemanSpiff has asked for the wisdom of the Perl Monks concerning the following question:

Hey guys and gals. I made this little test script to troubleshoot my logging into Yahoo.com (or the apparent inablility to do so within another script I'm writing). Now I know there's other pre-fab Yahoo modules and such, but I'm just trying to do my own thing and learn along the way.
#!/usr/bin/perl -w use strict; use WWW::Mechanize; use HTML::TokeParser; my $login = "xxxxxxxxxx"; my $password = "xxxxxxx"; my $url = "http://login.yahoo.com/config/login?"; my $mech = WWW::Mechanize->new(); $mech->get($url); $mech->form(); $mech->field("login","$login"); $mech->field("passwd","$password"); $mech->submit(); if ($mech->find_link( text => "Sign Out")){ print "Success!\n" } else{ print "Fail\n"; } my $test = HTML::TokeParser->new(\$mech->{content}); my $text = $test->get_text; print "$text";
Basically, the idea here was to attempt a login, then determine a success or failure by finding the sign out link. At the end I threw in a small parse command so I could see what the script is seeing. That's when I found out Yahoo is throwing even the unsecured logins through an SSL link. Here's the output:

Fail
LWP will support https URLs if the Crypt::SSLeay module is installed. More information at

Now I've read a few (apparently uninformed) sites on the web, and they've mentioned that Mech handles SSL natively. Further research seems to disprove this. Is my only option going through the whole crazy process of installing OpenSSL and then Crypt::SSLeay? It seems like a long way around just to get logged in. Help?
Thanks!

Replies are listed 'Best First'.
Re: Mech and SSL
by holli (Abbot) on Oct 01, 2005 at 09:02 UTC
    ...that Mech handles SSL natively.
    It does, but you need to install Crypt::SSLeay.
    Look at the error message!


    holli, /regexed monk/

    2005-10-02 Retitled by planetscape, as per Monastery guidelines
    Original title: 'Re: SSL hell'

      Well, I did look at the error message. Everything I've found says I need to install OpenSSL before I install Crypt before Mech will handle SSL. I guess I figured "natively" meant it was already in there and everything was set to go. We'll chalk that up as my misunderstanding.

      I'm running ActiveState Perl 5.8.7 with Komodo. I've tried to install Crypt through Komodo's Visual Package Manager, but couldn't even find it. Same result using the PPM utility. Searched the repositories to no avail.

      2005-10-02 Retitled by planetscape, as per Monastery guidelines
      Original title: 'Re^2: SSL hell'

Re: Mech and SSL
by Anonymous Monk on Oct 01, 2005 at 09:15 UTC
      I can't seem to locate Crypt::SSLeay through ActiveState in either the PPM or the VPM. Am I understanding that link correctly in that if I were able to find it, it would install without the need for me to install OpenSSL?

      Just installed build 618, which supposedly has SSLeay in it's repository, but it appears that the repository no longer exists. It can't connect.

        or at: http://theoryx5.uwinnipeg.ca/ppms/