in reply to LWP not working with HTTPS protocol (SOLVED)

Just FYI, I've noticed that the first test of LWP::Protocol::https fails because sometimes, when it tries to connect to the Apache Software Foundation, it connects ok; sometimes, it can't make a connection. For example, I installed it on 5.8.8 with no problems. A couple of hours later, I tried it on 5.16.0, but it couldn't connect. It seems the site is up and down frequently.

The modules are installed, so they should just work. I think that LWP needs to be told to do https, at least in this situation:
#!/usr/bin/perl -l use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, protocols_allowed => ['https'], ); my $req = HTTP::Request->new( GET => '', ); my $res = $ua->request($req); print $res->code;