Mojo::UserAgent fails on HTTPS-connection

If you have Debian 6 Squeeze and you try some of the pretty short samples of code from the manual, like this:

# Extract data from HTML and XML resources
say $ua->get('')->res->dom->html->head->title->text;

… you see just a message:
Can't locate object method "html" via package "Mojo::DOM" at line ...
It’s not a point, because the problem is that Mojo really doesn’t get https-content.
If you run this piece of code:

say $ua->get('')->res->error;

you see:
IO::Socket::SSL 1.75 required for TLS support
the most actual version for Squeeze is:
apt-cache showpkg libio-socket-ssl-perl
Package: libio-socket-ssl-perl

There was a discussion in Mojolicious Google Group about this version requirement, because it seems to be really necessary for IPv6.
Anyway the way is to update IO::Socket::SSL.
Make sure that you have installed full SSL stack for Debian/Perl for Mojolicious, and after that:
cpan IO::Socket::SSL

About Alyaxey Yaskevich

He is a linguist and techie interested in technical advance and mystery of a human soul.
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.