Net::S...::LDAP(3pm)
π Net::S...::LDAP β the manual, but make it make sense π
okay bestie, so this is the User Contributed Perl Documentation page for Net::S...::LDAP, section 3pm. sit down, grab a strawberry π, we're doing TLS certificate validation and we're doing it correctly.
β¨ NAME β¨
Net::SSLGlue::LDAP β proper certificate checking for ldaps in Net::LDAP. that's it, that's the whole vibe. no cap. π
π¦ SYNOPSIS π¦
use Net::SSLGlue::LDAP;
local %Net::SSLGlue::LDAP = ( SSL_verifycn_name => $hostname_in_cert );
my $ldap = Net::LDAP->new( $hostname, capath => ... );
$ldap->start_tls;
look at her. four lines. iconic. π
π DESCRIPTION π
so here's the tea, bestie: Net::SSLGlue::LDAP modifies Net::LDAP so that it does proper certificate checking using the "ldap" SSL_verify_scheme from IO::Socket::SSL. yes, the real thing. the certificate check that actually checks. we love to see it. π«Ά
the reason this module even exists? because Net::LDAP does not have a mechanism to forward arbitrary parameters for the construction of the underlying socket. so rude of it honestly. π so instead, those parameters can be set globally when including the package, or with local settings of the %Net::SSLGlue::LDAP::SSLopts variable.
and literally all of the "SSL_*" parameters from IO::Socket::SSL can be used here. every single one. but one of them is the main character and it's this one:
SSL_verifycn_nameβ usually the name you handed over as the hostname in the constructor is the one used to verify the identity of the certificate. but if you wanna check that cert against a different name instead, you specify it with this parameter. lowkey a lifesaver. πΈ
also, heads up on the naming situation, because it's giving confusing: "SSL_ca_path" and "SSL_ca_file" from IO::Socket::SSL can be set with the "capath" and "cafile" parameters of Net::LDAP::new, and "SSL_verify_mode" can be set with "verify" β but the meaning of the values differs. "none" is 0, e.g. disable certificate verification. π ma'am. that is the opposite of verification. know what you're setting, fr fr.
π SEE ALSO π
go read these too, bestie:
IO::Socket::SSLLWPNet::LDAP
π COPYRIGHT π
This module is copyright (c) 2008, 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.
and that's the whole page, babe π this beauty comes to you from perl v5.36.0, dated 2022-12-06, and yeah the title got cropped to Net::S...::LDAP(3pm) because apparently even man pages have a character limit. stay verified, stay valid, go check those certs. π§β¨π«Ά
π¦ 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