Debian 12 bookworm
Sponsored Link

OpenLDAP : LDAP over SSL/TLS2023/07/03

 
Configure LDAP over SSL/TLS to use secure encrypted connection.
[1]
[2] Configure LDAP Server.
root@dlp:~#
cp /etc/ssl/private/server.key \
/etc/ssl/private/server.crt \
/etc/ldap/sasl2/

root@dlp:~#
chown openldap:openldap /etc/ldap/sasl2/server.key \
/etc/ldap/sasl2/server.crt
root@dlp:~#
vi mod_ssl.ldif
# create new

dn: cn=config
changetype: modify
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/ldap/sasl2/server.crt
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/ldap/sasl2/server.key

root@dlp:~#
ldapmodify -Y EXTERNAL -H ldapi:/// -f mod_ssl.ldif

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"

root@dlp:~#
systemctl restart slapd
[3] Configure LDAP Client.
If you'd like to make sure the connection between LDAP server and client is encrypted, use tcpdump or other network capture softwares on LDAP server.
root@node01:~#
vi /etc/nslcd.conf
# line 29 : add

ssl start_tls
tls_reqcert allow
root@node01:~#
systemctl restart nslcd

root@node01:~#
exit
node01 login: bookworm     # LDAP user
Password:
Linux node01.srv.world 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Jul  2 19:38:36 CDT 2023 on ttyS0
bookworm@node01:~$      # logined
Matched Content