1Net::SSLGlue::LDAP(3) User Contributed Perl DocumentationNet::SSLGlue::LDAP(3)
2
3
4
6 Net::SSLGlue::LDAP - proper certificate checking for ldaps in Net::LDAP
7
9 use Net::SSLGlue::LDAP;
10 local %Net::SSLGlue::LDAP = ( SSL_verifycn_name => $hostname_in_cert );
11 my $ldap = Net::LDAP->new( $hostname, capath => ... );
12 $ldap->start_tls;
13
15 Net::SSLGlue::LDAP modifies Net::LDAP so that it does proper
16 certificate checking using the "ldap" SSL_verify_scheme from
17 IO::Socket::SSL.
18
19 Because Net::LDAP does not have a mechanism to forward arbitrary
20 parameters for the construction of the underlying socket these
21 parameters can be set globally when including the package, or with
22 local settings of the %Net::SSLGlue::LDAP::SSLopts variable.
23
24 All of the "SSL_*" parameters from IO::Socket::SSL can be used; the
25 following parameter is especially useful:
26
27 SSL_verifycn_name
28 Usually the name given as the hostname in the constructor is used
29 to verify the identity of the certificate. If you want to check the
30 certificate against another name you can specify it with this
31 parameter.
32
33 "SSL_ca_path", "SSL_ca_file" for IO::Socket::SSL can be set with the
34 "capath" and "cafile" parameters of Net::LDAP::new and
35 "SSL_verify_mode" can be set with "verify", but the meaning of the
36 values differs ("none" is 0, e.g. disable certificate verification).
37
39 IO::Socket::SSL, LWP, Net::LDAP
40
42 This module is copyright (c) 2008, Steffen Ullrich. All Rights
43 Reserved. This module is free software. It may be used, redistributed
44 and/or modified under the same terms as Perl itself.
45
46
47
48perl v5.32.1 2021-01-27 Net::SSLGlue::LDAP(3)