Net::LDAPS(3)

✨ NAME ✨

Net::LDAPS β€” use LDAP over an SSL connection. Also hiiii bestie, this is the Net::LDAPS(3) page from the User Contributed Perl Documentation, and it’s giving secure-directory-connection main character energy. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

Okay so there are two ways to slide into the same SSL-secured LDAP situation:

use Net::LDAPS;

$ldaps = Net::LDAPS->new('myhost.example.com',
                         port => '10000',
                         verify => 'require',
                         capath => '/usr/local/cacerts/');

# alternate way
use Net::LDAP;

$ldaps = Net::LDAP->new('ldaps://myhost.example.com:10000',
                        verify => 'require',
                        capath => '/usr/local/cacerts/');

Pick your fighter, bestie. Both are right there in the code. 🫢


πŸ’– DESCRIPTION πŸ’–

So basically you’re communicating using the LDAP protocol to a directory server, but over an encrypted (SSL) network connection. Iconic. ✨

Heads up though: this mechanism is non-standard but widely supported. If you can, consider using LDAPv3 with the standard TLS extension instead β€” because many servers do not support it yet. 😭 See start_tls in Net::LDAP for that.

All the normal Net::LDAP methods can be used with a Net::LDAPS object; see Net::LDAP for details. No cap, that’s the whole vibe. 🌸


πŸ› οΈ CONSTRUCTOR πŸ› οΈ

new ( HOST [, OPTIONS ] )

Create a new connection, periodt. HOST is the hostname to contact. OPTIONS is a number of key/value pairs. See "new" in Net::LDAP for details. πŸ’–


πŸ‘€ SEE ALSO πŸ‘€

Go check out these icons:

  • Net::LDAP
  • IO::Socket::SSL

πŸ’€ BUGS πŸ’€

Okay so the major catch: you cannot have more than one LDAPS connection at any one time, due to restrictions in the underlying Net::SSLeay code. That’s not a drill, bestie. 😭


πŸ‘‘ AUTHOR πŸ‘‘

Big shoutout to Chris Ridd <chris.ridd@isode.com>. πŸ’–


Legally cute, legally clear:

Copyright (c) 2000-2004, Chris Ridd and Graham Barr. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

mwah πŸ’‹ β€” this page is from perl v5.42.0, dated 2024-01-02, and it’s the Net::LDAPS(3) page. bye bestie, go secure those directories 🫢

πŸ“¦ where this page comes from