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

Hi Monks, I would like to use LWP modules to access a https website. How do i make https and LWP work as the modules seem to work only for http

Replies are listed 'Best First'.
Re: LWP and https
by rob_au (Abbot) on Dec 29, 2003 at 21:52 UTC
    From the file README.SSL in the LWP distribution ...

    SSL SUPPORT
    -----------
    
    The libwww-perl package has support for using SSL/TLSv1 with its HTTP
    client and server classes. This support makes it possible to access
    https schemed URLs with LWP. Because of the problematic status of
    encryption software in general and certain encryption algorithms in
    particular, in several countries, libwww-perl package doesn't include
    SSL functionality out-of-the-box.
    
    Encryption support is obtained through the use of Crypt::SSLeay or
    IO::Socket::SSL, which can both be found from CPAN. While libwww-perl
    has "plug-and-play" support for both of these modules (as of v5.45),
    the recommended module to use is Crypt::SSLeay. In addition to
    bringing SSL support to the LWP package, IO::Socket::SSL can be used
    as an object oriented interface to SSL encrypted network sockets.
    
    There is yet another SSL interface for perl called Net::SSLeay. It has
    a more complete SSL interface and can be used for web client
    programming among other things but doesn't directly support LWP.
    
    The underlying SSL support in all of these modules is based on OpenSSL
    <http://www.openssl.org/> (formerly SSLeay). For WWW-server side SSL
    support (e.g. CGI/FCGI scripts) in Apache see <http://www.modssl.org/>.
    
    

    In short to add HTTPS support to LWP, simply install either Crypt::SSLeay or IO::Socket::SSL.

     

    perl -le "print+unpack'N',pack'B32','00000000000000000000001010100011'"

Re: LWP and https
by inman (Curate) on Dec 30, 2003 at 09:25 UTC
    Assuming that you are using ActiveState ...

    This message makes it clear that Activestate have withdrawn the crypto packages required for SSL access from their PPM server. You will have to access one of the other PPM repositories listed in PPM::Repositories.