in reply to Get https simple solution desired

WWW::Mechanize uses LWP::UserAgent. LWP::UserAgent needs LWP::Protocol::https to access https:// websites. That module isn't easily installed as it needs SSL libraries installed on the target system.

Your best approach would be to contact the webserver administrator to get them to install LWP::Protocol::https on the machine.

Alternatively, maybe some command line tools are available that already have https capabilities, like wget or curl. Then you can use these to fetch the data.

Replies are listed 'Best First'.
Re^2: Get https simple solution desired
by hippo (Archbishop) on Jun 01, 2018 at 10:03 UTC
    Alternatively, maybe some command line tools are available that already have https capabilities, like wget or curl. Then you can use these to fetch the data.

    Or better yet, use modules such as Net::Curl::Easy which leverage their libraries and avoid shelling out.

      ... if that library is installed, and a C compiler is installed. Both of which are close prerequisites to getting SSL working.

      A statically linked wget or curl binary is more likely to be available in cases where SSL libraries are unavailable.

        if that library is installed

        If the curl executable is installed and working how could the library not be present? I suppose they could have a statically-compiled curl but I've never seen that in the wild.

        and a C compiler is installed

        Good point. That's the much more likely blocker I think. If I were Yahoo (and thank the Old Gods and the New that I am not) there wouldn't be a compiler on these customer-accessible nodes either.

        Is there a pure-perl SSL implementation somewhere on CPAN or did I just dream that?

Re^2: Get https simple solution desired
by tbone654 (Beadle) on Jun 01, 2018 at 13:48 UTC

    That is exactly the problem with using WWW::Mechanize

    Software error: GET https://finance.yahoo.com/quote/SPY/history?p=SPY failed: 501 Prot +ocol scheme 'https' is not supported (LWP::Protocol::https not instal +led) at /test/aaa3.pl line 42
    I know I have LWP::Protocol::https.pm installed in the correct spot, and I know the problem is the same with any module that has XSLoader or Dynaloader as a dependancy to load libraries.

    Yahoo does have these modules, (32 with LWP in them) and maybe then libraries, but I think they must be a little stale and I don't know how to make the link to them.

    LWP::Protocol - Base class for LWP protocols
    LWP::Simple - simple procedural interface to LWP
    LWP::UserAgent - Web user agent class
    DBI 5.8.7::LWP - The World-Wide Web library for Perl
    5.8.7::Bundle::LWP - install all libwww-perl related modules
    5.8.7::LWP::Protocol - Base class for LWP protocols
    5.8.7::LWP::Simple - simple procedural interface to LWP
    5.8.7::LWP::UserAgent - Web user agent class


    Do I just call them by use 5.8.7::LWP::Protocol; and hope for the best?
    My experience is that Yahoo is not interested in adding libraries, and I have had no luck figuring out how to upload a library and then getting LWP to recognize it's path.

    Net::SSLeay object version 1.25 does not match bootstrap parameter 1.85 at ../lib4/Net/SSLeay.pm line 444.
    Compilation failed in require at ../lib4/IO/Socket/SSL.pm line 19.

    What I believe it is telling might be that:
    18 use IO::Socket;
    19 use Net::SSLeay 1.46;
    20 use IO::Socket::SSL::PublicSuffix;
    21 use Exporter ();

    The object file (ver 1.25) is the library on the host... IO/Socket/SSL.pm wants to know (ver 1.46)... and Net/SSLeay.pm wants (ver 1.85)

    Thank you very much for your help