[Israel.pm] Perl and HTTPS domains

sawyer x xsawyerx at gmail.com
Thu Dec 27 00:57:52 PST 2012


Last meeting someone asked about handling HTTPS domains in Perl,
specifically using WWW::Mechanize.

Shortest version (for Windows only):
1. Install DWIM Perl.

Relatively short version:
1. Install the OpenSSL C development library. I'd be happy if someone
shared how to do this on Windows. In Debian (and Debian-based) GNU/Linux
you'll need libssl-dev, in RedHat (and RedHat-based) GNU/Linux you'll need
openssl-devel.
2. Install Crypt::OpenSSL.
3. Make sure you have LWP::Protocol::https module installed.
Done.

Long version (explanation):
Since WWW::Mechanize is basically a sophisticated wrapper around LWP, it
will use LWP::UserAgent. LWP used to be a big library, but now it's split
into many little libraries. One of these is the HTTPS protocol library for
LWP called LWP::Protocol::https, which is what LWP::UserAgent will use to
fetch pages from HTTPS URLs. It will in turn use the OpenSSL library (known
by the original name for OpenSSL): Crypt::SSLeay. Since Crypt::SSLeay is
basically bindings to the OpenSSL C library, you'll need to have that
installed.

So, you'll need to install the OpenSSL C library (development files:
headers, etc.), the Perl bindings (Crypt::SSLeay), the LWP HTTPS protocol
(LWP::Protocol::https) and from that point LWP::UserAgent and
WWW::Mechanize will use HTTPS seamlessly.

Hope that helps!
Sawyer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20121227/7915e914/attachment.htm 


More information about the Perl mailing list