I'm using "wxer.pl" to retrieve weather information (temperature, humidity) for monitoring purposes.
It uses CPAN module "Weather::Underground to fetch the actual data.
All of a sudden, it stopped working, throwing the following error message:
[SOLUTION]Error, calling get_weather() failed: Could not retrieve HTML document http://mobile.wunderground.com/cgi-bin/ ... ery=$PLACE
Install the CPAN module "LWP::Protocol::https" in order to access SSL secured websites.
In recent Debian-based distros, it could/should be in the repositories under the following name:
Code: Select all
liblwp-protocol-https-perl
Code: Select all
$ sudo cpan install LWP::Protocol::https
[REMARKS]
The same code worked flawless on another machine, and I also could "wget" the URL listed as not working.
I've manually tried to reproduce the call of "LWP::Simple->get()", in order to gain more details about what's going wrong.
The result was:
Opening the site "http://mobile.wunderground.com", I now saw that it automatically redirects to https://LWP will support https URLs if the LWP::Protocol::https module is installed.
Installing the "LWP::Protocol::https" CPAN Module was not as straightforward as expected, because "SSLeay" failed to compile - because "libssl-dev" package was missing.
After that, the "LWP::Protocol::https" didn't install, and threw the following error:
I couldn't figure out why, but in order to proceed somehow, I force-installed the CPAN module:# Failed test at t/apache.t line 15.
#
# Failed test at t/apache.t line 16.
# 'Can't connect to www.apache.org:443 (certificate+verify failed)
Code: Select all
$ cpan -fi LWP::Protocol::https