LWP::UserAgent and HTTPS

If you are trying to download a website with LWP::UserAgent in Perl through HTTPS, you might encounter errors like this:

Can't locate object method "new" via package "LWP::Protocol::https::Socket"


Can't connect -- 501 Protocol scheme 'https' is not supported (Crypt::SSLeay or IO::Socket::SSL not installed) at somefile.pl line something.

The solution to this problem is to install the ssl development libraries, and then install the Crypt::SSLeay Perl module. To do this in Debian or Ubuntu, open a terminal and type in the following:

sudo aptitude install libssl-dev sudo cpan -i Crypt::SSLeay

This should fix your problem.

Written by Jannich Brendle man 03 maj 2010 In Programming

tags: developmentperl

Related posts