Net::S...ue::LWP(3pm)
π NAME π
Net::SSLGlue::LWP β proper certificate checking for https in LWP. Like, actual, real, grown-up cert verification bestie, no vibes-based trust here. It's giving security β¨
π SYNOPSIS π
u use Net::SSLGlue::LWP SSL_ca_path => ...;
use LWP::Simple;
get( 'https://www....' );
{
local %Net::SSLGlue::LWP::SSLopts = %Net::SSLGlue::LWP::SSLopts;
# switch off verification
$Net::SSLGlue::LWP::SSLopts{SSL_verify_mode} = 0;
# or: set different verification policy, because cert does
# not conform to RFC (wildcards in CN are not allowed for https,
# but some servers do it anyway)
$Net::SSLGlue::LWP::SSLopts{SSL_verifycn_scheme} = {
wildcards_in_cn => 'anywhere',
check_cn => 'always',
};
}
ok yes that leading u is literally in the original, I did not typo it, it's giving OCR energy π copying it exactly because that's the rules. periodt.
π¦ DESCRIPTION π¦
So here's the tea β Net::SSLGlue::LWP modifies Net::HTTPS and LWP::Protocol::https so that:
Net::HTTPSis forced to useIO::Socket::SSLinstead ofCrypt::SSLeay(we do not stan the old one), andLWP::Protocol::httpsdoes proper certificate checking using the"http"SSL_verify_schemefromIO::Socket::SSL.
lowkey important: this module should only be used for older LWP versions β peep the Supported LWP versions section below, bestie π
The thing is, LWP has no mechanism to forward arbitrary parameters for the construction of the underlying socket π so instead these parameters can be set:
- globally when including the package, or
- with local settings of the
%Net::SSLGlue::LWP::SSLoptsvariable.
All of the "SSL_*" parameters from IO::Socket::SSL can be used, no cap. But these ones are especially useful:
SSL_ca_path,SSL_ca_fileβ specifies the path, or a file, where the CAs used for checking the certificates are located. On UNIX systems this is typically"etc/ssl/certs". It's the lil home of all your trust anchors π πSSL_verify_modeβ if you set this to0, verification of the certificate will be disabled π¨ (dramatic, dangerous, do not casually). By default it is set to1, which means the peer certificate is checked. Slay. Keep it at 1.SSL_verifycn_nameβ usually the name given as the hostname in the constructor is used to verify the identity of the certificate. But if you wanna check the certificate against a different name, you specify it with this parameter. Main character name-swap energy π
π Supported LWP versions π
This module should be used for older LWP versions only, bestie, I'm so serious.
Starting with version 6.06 it is recommended to use LWP directly β it can handle its own life now, it doesn't need us π
And if a recent version is found, Net::SSLGlue::LWP will print out a warning and not monkey patch too much into LWP β only as much as necessary to still support %Net::SSLGlue::LWP::SSLopts. So it's polite about it π«Ά
π SEE ALSO π
IO::Socket::SSLLWPNet::HTTPSLWP::Protocol::https
go read those, they're iconic, fr fr πβ¨
π COPYRIGHT π
This module is copyright (c) 2008..2015, Steffen Ullrich. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. π
ok bye bestie, that's the whole page, you ate it π
β¨ this was Net::S...ue::LWP(3pm), part of the User Contributed Perl Documentation, and the footer says it's from perl v5.36.0, dated 2022-12-06 β so yes she's a lil vintage but she still slays π¦πΈπ
π¦ where this page comes from
- debian bookworm: libnet-sslglue-perl 1.058-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-sslglue-perl 1.058-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-sslglue-perl 1.058-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-sslglue-perl 1.058-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-sslglue-perl 1.058-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms