Updated: 10 November 2026 · Applies to: AlmaLinux 9.8 and 10.2, Debian 13, Ubuntu 24.04 (libwww-perl 6.53 to 6.78), cPanel and WHM
The message "LWP will support https URLs if the LWP::Protocol::https module is installed" means a Perl script (often a cron job) uses LWP to fetch an https:// address, but the Perl module that adds HTTPS to LWP is missing. Install it as root and the script works again:
dnf install perl-LWP-Protocol-https
That is for AlmaLinux and Rocky Linux. On Debian and Ubuntu the package is liblwp-protocol-https-perl. Details, the cPanel method and how to check the result are below.
What the error looks like
We reproduced it on AlmaLinux 9.8 with only perl-libwww-perl installed. A cron job that runs lwp-request (or a script that prints the response body) mails you this text:
LWP will support https URLs if the LWP::Protocol::https module is installed.
A script that prints the status line shows the same problem in a different form:
501 Protocol scheme 'https' is not supported (LWP::Protocol::https not installed)
Both come from LWP/UserAgent.pm: when LWP cannot load a handler for the https scheme, it returns a 501 response with that message instead of contacting the server. Nothing is wrong with the remote site or your SSL certificate.
Why it happens
- AlmaLinux, Rocky Linux and other RHEL-based systems: HTTPS support is a separate package. Installing
perl-libwww-perldoes not pull inperl-LWP-Protocol-https, so LWP works forhttp://addresses but not forhttps://. We saw this on both AlmaLinux 9 and 10. - Debian and Ubuntu:
libwww-perldepends onliblwp-protocol-https-perl, so a normal package install always includes it. If you get the error there, the script is most likely using a different Perl or a copy of LWP installed from CPAN. - A different Perl in cron: cron runs with a short
PATH. Theperlit finds, or the one named on the script's first line (the shebang, for example#!/usr/bin/perl), may not be the Perl you tested with in your shell.
Fix on AlmaLinux and Rocky Linux 9 or 10
- Log in over SSH as root (or use
sudo). - Install the module. dnf also pulls in
perl-IO-Socket-SSLandperl-Mozilla-CA(the certificate bundle):dnf install perl-LWP-Protocol-https
- Check the installed packages:
rpm -q perl-LWP-Protocol-https perl-IO-Socket-SSL perl-Mozilla-CA
Output on AlmaLinux 9.8:
perl-LWP-Protocol-https-6.10-4.el9.noarch perl-IO-Socket-SSL-2.073-2.el9.noarch perl-Mozilla-CA-20200520-6.el9.noarch
AlmaLinux 10.2 installed version 6.13 of the same package.
Fix on Debian and Ubuntu
apt update apt install liblwp-protocol-https-perl
On Debian 13 this installed version 6.14, on Ubuntu 24.04 version 6.13.
Fix with CPAN (any distribution or a custom Perl)
Use this when the script runs a Perl that is not the system one, or when LWP itself came from CPAN. Run it with the same Perl the script uses:
cpan LWP::Protocol::https
On AlmaLinux 9 (with perl-CPAN, make and the system perl-IO-Socket-SSL already installed) this built LWP-Protocol-https 6.17 and installed it under /usr/local/share/perl5/. If IO::Socket::SSL is not installed yet, CPAN also builds Net::SSLeay, which needs a compiler and the OpenSSL development headers, so the distribution package above is the easier route where it exists.
Fix on a cPanel server
According to cPanel's documentation, WHM's Software › Install a Perl Module page finds and installs modules from CPAN into the system Perl:
- Log in to WHM as root.
- Open Software › Install a Perl Module.
- Type
LWP::Protocol::httpsin the Install a Perl Module box and click Install Now.
On a shared hosting account you cannot install system modules yourself: open a support ticket and ask for LWP::Protocol::https to be installed.
Check that it works
Print the module version with the same Perl your cron job uses:
perl -MLWP::Protocol::https -e 'print "LWP::Protocol::https $LWP::Protocol::https::VERSION\n"'
Output on AlmaLinux 10.2:
LWP::Protocol::https 6.13
If it says "Can't locate LWP/Protocol/https.pm in @INC (you may need to install the LWP::Protocol::https module)", that Perl still does not have the module. Then run a short test script:
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new(timeout => 15);
my $res = $ua->get('https://www.debian.org/');
print $res->is_success ? "OK: " : "FAILED: ", $res->status_line, "\n";
Before the fix it printed FAILED: 501 Protocol scheme 'https' is not supported (LWP::Protocol::https not installed); after installing the module it printed:
OK: 200 OK
Finally run the cron command once by hand, exactly as it appears in the crontab, to confirm. See Cron Jobs in cPanel: Add, View, Edit and Delete or How to List All Cron Jobs for All Users in Linux to find it.
Still failing after the install?
- Different Perl: run
head -1on the script and compare the shebang withwhich perl. Install the module for the Perl the script really uses. Perl version, Path to Perl and Sendmail explains the paths. - "500 Can't connect to example.com:443 (certificate verify failed)": that is a different problem. The HTTPS module now works, but the certificate check failed: the remote certificate is invalid or expired, or the CA bundle (
perl-Mozilla-CAorca-certificates) is missing. We got this message when testing against a site with an expired certificate. - Missing modules during updates: see How to resolve Missing perl module during the packages update.
Official documentation: cPanel: Install a Perl Module.