wget https:\/\/www.openldap.org\/software\/download\/OpenLDAP\/openldap-release\/openldap-${VER}.tgz<\/code><\/pre>\n\n\n\nThe tarball can be extracted by running the command;<\/p>\n\n\n\n
tar xzf openldap-$VER.tgz<\/pre>\n\n\n\nInstall OpenLDAP Server on Debian 12<\/h4>\n\n\n\n
Compile and install OpenLDAP server on Debian 12 as follows;<\/p>\n\n\n\n
cd openldap-$VER<\/code><\/pre>\n\n\n\n\n.\/configure --prefix=\/usr --sysconfdir=\/etc --disable-static \\\n--enable-debug --with-tls=openssl --with-cyrus-sasl \\\n--enable-dynamic --enable-crypt --enable-spasswd \\\n--enable-slapd --enable-modules --enable-rlookups \\\n--enable-backends=mod --disable-sql --enable-ppolicy=mod \\\n--enable-syslog --enable-overlays=mod --with-systemd --enable-wt=no\n<\/code><\/pre>\n\n\n\nIf the command ends with an error, fix it before you can proceed. Otherwise, with no error, the command should end with such output;<\/p>\n\n\n\n
...\nMaking servers\/slapd\/backends.c\n Add config ...\n Add ldif ...\n Add monitor ...\nMaking servers\/slapd\/overlays\/statover.c\nPlease run \"make depend\" to build dependencies\n<\/code><\/pre>\n\n\n\nNext, run the make depend<\/strong><\/code> command to build OpenLDAP dependencies.<\/p>\n\n\n\nmake depend<\/code><\/pre>\n\n\n\nCompile OpenLDAP on Debian 12.<\/p>\n\n\n\n
make<\/code><\/pre>\n\n\n\nEnsure the command completes with no error. Fix any error, if there is, before you can proceed.<\/p>\n\n\n\n
make install<\/code><\/pre>\n\n\n\nConfiguring OpenLDAP on Debian 12<\/h3>\n\n\n\nCreate Data and Database Directories<\/h4>\n\n\n\n
Create OpenLDAP data and database directories<\/p>\n\n\n\n
mkdir \/var\/lib\/openldap \/etc\/openldap\/slapd.d<\/code><\/pre>\n\n\n\nSet the proper ownership and permissions on OpenLDAP directories and configuration files.<\/p>\n\n\n\n
chown -R ldap:ldap \/var\/lib\/openldap<\/code><\/pre>\n\n\n\nchown root:ldap \/etc\/openldap\/slapd.conf<\/code><\/pre>\n\n\n\nchmod 640 \/etc\/openldap\/slapd.conf<\/code><\/pre>\n\n\n\nUpdate OpenLDAP Service<\/h4>\n\n\n\n
We will update the created OpenLDAP service file;<\/p>\n\n\n\n
mv \/lib\/systemd\/system\/slapd.service{,.old}<\/code><\/pre>\n\n\n\n\ncat > \/etc\/systemd\/system\/slapd.service << 'EOL'\n[Unit]\nDescription=OpenLDAP Server Daemon\nAfter=syslog.target network-online.target\nDocumentation=man:slapd\nDocumentation=man:slapd-mdb\n\n[Service]\nType=forking\nPIDFile=\/var\/lib\/openldap\/slapd.pid\nEnvironment=\"SLAPD_URLS=ldap:\/\/\/ ldapi:\/\/\/ ldaps:\/\/\/\"\nEnvironment=\"SLAPD_OPTIONS=-F \/etc\/openldap\/slapd.d\"\nExecStart=\/usr\/libexec\/slapd -u ldap -g ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS\n\n[Install]\nWantedBy=multi-user.target\nEOL\n<\/code><\/pre>\n\n\n\nCreate OpenLDAP SUDO Schema<\/h4>\n\n\n\n
To configure LDAP with support sudo<\/code>, first, install sudo-ldap package.<\/p>\n\n\n\napt install sudo-ldap<\/code><\/pre>\n\n\n\nYou can then verify the sudo OpenLDAP.<\/p>\n\n\n\n
sudo -V | grep -i \"ldap\"<\/code><\/pre>\n\n\n\nIf sudo supports LDAP, you should see the lines below;<\/p>\n\n\n\n
...\nldap.conf path: \/etc\/sudo-ldap.conf\nldap.secret path: \/etc\/ldap.secret<\/code><\/pre>\n\n\n\nCheck if LDAP sudo schema is available.<\/p>\n\n\n\n
find \/usr\/share\/doc\/ -iname schema.openldap<\/code><\/pre>\n\n\n\nOutput;<\/p>\n\n\n\n
\/usr\/share\/doc\/sudo-ldap\/schema.OpenLDAP<\/code><\/pre>\n\n\n\nCopy the schema.OpenLDAP<\/code> to the schema directory.<\/p>\n\n\n\ncp \/usr\/share\/doc\/sudo-ldap\/schema.OpenLDAP \/etc\/openldap\/schema\/sudo.schema<\/code><\/pre>\n\n\n\nNext, you need to create sudo schema ldif file.<\/p>\n\n\n\n
Run the command below to create the sudo.ldif<\/strong><\/code> file. (We copied the default ldif file from \/usr\/share\/doc\/sudo-ldap\/schema.olcSudo<\/code><\/strong> and just modified it<\/em>).<\/p>\n\n\n\n\ncat << 'EOL' > \/etc\/openldap\/schema\/sudo.ldif\ndn: cn=sudo,cn=schema,cn=config\nobjectClass: olcSchemaConfig\ncn: sudo\nolcattributetypes: ( 1.3.6.1.4.1.15953.9.1.1\n NAME 'sudoUser'\n DESC 'User(s) who may run sudo'\n EQUALITY caseExactMatch\n SUBSTR caseExactSubstringsMatch\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )\n#\nolcattributetypes: ( 1.3.6.1.4.1.15953.9.1.2\n NAME 'sudoHost'\n DESC 'Host(s) who may run sudo'\n EQUALITY caseExactIA5Match\n SUBSTR caseExactIA5SubstringsMatch\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )\n#\nolcattributetypes: ( 1.3.6.1.4.1.15953.9.1.3\n NAME 'sudoCommand'\n DESC 'Command(s) to be executed by sudo'\n EQUALITY caseExactIA5Match\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )\n#\nolcattributetypes: ( 1.3.6.1.4.1.15953.9.1.4\n NAME 'sudoRunAs'\n DESC 'User(s) impersonated by sudo (deprecated)'\n EQUALITY caseExactIA5Match\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )\n#\nolcattributetypes: ( 1.3.6.1.4.1.15953.9.1.5\n NAME 'sudoOption'\n DESC 'Options(s) followed by sudo'\n EQUALITY caseExactIA5Match\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )\n#\nolcattributetypes: ( 1.3.6.1.4.1.15953.9.1.6\n NAME 'sudoRunAsUser'\n DESC 'User(s) impersonated by sudo'\n EQUALITY caseExactMatch\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )\n#\nolcattributetypes: ( 1.3.6.1.4.1.15953.9.1.7\n NAME 'sudoRunAsGroup'\n DESC 'Group(s) impersonated by sudo'\n EQUALITY caseExactMatch\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )\n#\nolcattributetypes: ( 1.3.6.1.4.1.15953.9.1.8\n NAME 'sudoNotBefore'\n DESC 'Start of time interval for which the entry is valid'\n EQUALITY generalizedTimeMatch\n ORDERING generalizedTimeOrderingMatch\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )\n#\nolcattributetypes: ( 1.3.6.1.4.1.15953.9.1.9\n NAME 'sudoNotAfter'\n DESC 'End of time interval for which the entry is valid'\n EQUALITY generalizedTimeMatch\n ORDERING generalizedTimeOrderingMatch\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 )\n#\nolcattributeTypes: ( 1.3.6.1.4.1.15953.9.1.10\n NAME 'sudoOrder'\n DESC 'an integer to order the sudoRole entries'\n EQUALITY integerMatch\n ORDERING integerOrderingMatch\n SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )\n#\nolcobjectclasses: ( 1.3.6.1.4.1.15953.9.2.1 NAME 'sudoRole' SUP top STRUCTURAL\n DESC 'Sudoer Entries'\n MUST ( cn )\n MAY ( sudoUser $ sudoHost $ sudoCommand $ sudoRunAs $ sudoRunAsUser $ sudoRunAsGroup $ sudoOption $ sudoOrder $ sudoNotBefore $ sudoNotAfter $\n description )\n )\nEOL\n<\/code><\/pre>\n\n\n\nUpdate SLAPD Database<\/h4>\n\n\n\n
Edit the SLAPD LDIF file, \/etc\/openldap\/slapd.ldif<\/strong><\/code>, and update it as follows;<\/p>\n\n\n\nmv \/etc\/openldap\/slapd.ldif{,.bak}<\/code><\/pre>\n\n\n\n\ncat > \/etc\/openldap\/slapd.ldif << 'EOL'\ndn: cn=config\nobjectClass: olcGlobal\ncn: config\nolcArgsFile: \/var\/lib\/openldap\/slapd.args\nolcPidFile: \/var\/lib\/openldap\/slapd.pid\n\ndn: cn=schema,cn=config\nobjectClass: olcSchemaConfig\ncn: schema\n\ndn: cn=module,cn=config\nobjectClass: olcModuleList\ncn: module\nolcModulepath: \/usr\/libexec\/openldap\nolcModuleload: back_mdb.la\nolcModuleload: ppolicy.la\n\n\ninclude: file:\/\/\/etc\/openldap\/schema\/core.ldif\ninclude: file:\/\/\/etc\/openldap\/schema\/cosine.ldif\ninclude: file:\/\/\/etc\/openldap\/schema\/nis.ldif\ninclude: file:\/\/\/etc\/openldap\/schema\/inetorgperson.ldif\ninclude: file:\/\/\/etc\/openldap\/schema\/sudo.ldif\n#include: file:\/\/\/etc\/openldap\/schema\/ppolicy.ldif\ndn: olcDatabase=frontend,cn=config\nobjectClass: olcDatabaseConfig\nobjectClass: olcFrontendConfig\nolcDatabase: frontend\nolcAccess: to dn.base=\"cn=Subschema\" by * read\nolcAccess: to * \n by dn.base=\"gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\" manage \n by * none\n\ndn: olcDatabase=config,cn=config\nobjectClass: olcDatabaseConfig\nolcDatabase: config\nolcRootDN: cn=config\nolcAccess: to * \n by dn.base=\"gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\" manage \n by * none\nEOL\n<\/code><\/pre>\n\n\n\n\n- To update the SLAPD database from the information provided on the SLAPD LDIF file above, use
slapadd<\/strong><\/code> command with the option -n 0<\/strong><\/code> which creates the first database.<\/li>\n\n\n\n- To specify the configuration directory,
\/etc\/openldap\/slapd.d<\/code><\/strong>, use option -F<\/code><\/strong> and option -l<\/code><\/strong> to specify location of the LDIF file above.<\/li>\n<\/ul>\n\n\n\nBefore you can write the changes to the database, perform a dry run to see what would happen. Pass -u<\/code><\/strong> option to slapadd command.<\/p>\n\n\n\nslapadd -n 0 -F \/etc\/openldap\/slapd.d -l \/etc\/openldap\/slapd.ldif -u<\/code><\/pre>\n\n\n\nIf the command do not output any error, then all is fine.<\/p>\n\n\n\n
Then implement the changes if all is well.<\/p>\n\n\n\n
slapadd -n 0 -F \/etc\/openldap\/slapd.d -l \/etc\/openldap\/slapd.ldif<\/code><\/pre>\n\n\n\nThis command creates slapd database configurations under \/etc\/openldap\/slapd.d<\/code> directory.<\/p>\n\n\n\nls \/etc\/openldap\/slapd.d<\/code><\/pre>\n\n\n\n'cn=config' 'cn=config.ldif'<\/code><\/pre>\n\n\n\nSet the user and group ownership of the \/etc\/openldap\/slapd.d<\/code> directory and the files in it to ldap user.<\/p>\n\n\n\nchown -R ldap:ldap \/etc\/openldap\/slapd.d<\/code><\/pre>\n\n\n\nRunning OpenLDAP Service<\/h4>\n\n\n\n
Reload systemd configurations and start OpenLDAP service.<\/p>\n\n\n\n
systemctl daemon-reload<\/code><\/pre>\n\n\n\nsystemctl enable --now slapd<\/code><\/pre>\n\n\n\nCheck status;<\/p>\n\n\n\n
systemctl status slapd<\/code><\/pre>\n\n\n\n\n\u25cf slapd.service - OpenLDAP Server Daemon\n Loaded: loaded (\/etc\/systemd\/system\/slapd.service; enabled; preset: enabled)\n Active: active (running) since Fri 2023-07-07 13:54:52 EDT; 3s ago\n Docs: man:slapd\n man:slapd-mdb\n Process: 61559 ExecStart=\/usr\/libexec\/slapd -u ldap -g ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=0\/SUCCESS)\n Main PID: 61560 (slapd)\n Tasks: 2 (limit: 4642)\n Memory: 5.3M\n CPU: 29ms\n CGroup: \/system.slice\/slapd.service\n \u2514\u250061560 \/usr\/libexec\/slapd -u ldap -g ldap -h \"ldap:\/\/\/ ldapi:\/\/\/ ldaps:\/\/\/\" -F \/etc\/openldap\/slapd.d\n\nJul 07 13:54:52 ldapmaster.kifarunix-demo.com systemd[1]: Starting slapd.service - OpenLDAP Server Daemon...\nJul 07 13:54:52 ldapmaster.kifarunix-demo.com slapd[61559]: @(#) $OpenLDAP: slapd 2.6.4 (Jul 7 2023 12:06:42) $\n root@debian:\/root\/openldap-2.6.4\/servers\/slapd\nJul 07 13:54:52 ldapmaster.kifarunix-demo.com slapd[61560]: slapd starting\nJul 07 13:54:52 ldapmaster.kifarunix-demo.com systemd[1]: Started slapd.service - OpenLDAP Server Daemon.\n<\/code><\/pre>\n\n\n\nConfirm that the ports are listening;<\/p>\n\n\n\n
ss -altnp | grep slapd<\/code><\/pre>\n\n\n\n\nLISTEN 0 2048 0.0.0.0:636 0.0.0.0:* users:((\"slapd\",pid=60891,fd=10))\nLISTEN 0 2048 0.0.0.0:389 0.0.0.0:* users:((\"slapd\",pid=60891,fd=7)) \nLISTEN 0 2048 [::]:636 [::]:* users:((\"slapd\",pid=60891,fd=11))\nLISTEN 0 2048 [::]:389 [::]:* users:((\"slapd\",pid=60891,fd=8))\n<\/pre><\/code>\n\n\n\nBy default, OpenLDAP logging level is set to none<\/code> which is required to have high priority messages only logged.<\/p>\n\n\n\nYou can change this to a different log level<\/a>, say to stats<\/code> level (logs connections\/operations\/results), run the command below;<\/p>\n\n\n\nldapmodify -Y EXTERNAL -H ldapi:\/\/\/ -Q<\/code><\/pre>\n\n\n\nThe copy and paste the content below on the prompt to modify the log level.<\/p>\n\n\n\n
dn: cn=config\nchangeType: modify\nreplace: olcLogLevel\nolcLogLevel: stats<\/code><\/pre>\n\n\n\nNext, press ENTER<\/strong> twice<\/strong>.<\/p>\n\n\n\nOnce you see a line, modifying entry \"cn=config\"<\/strong><\/code>, then press Ctrl+d<\/strong><\/code>\/ctrl+c<\/strong>.<\/p>\n\n\n\nYou can as well use LDIF files to update this information if you like.<\/p>\n\n\n\n
To confirm the changes;<\/p>\n\n\n\n
ldapsearch -Y EXTERNAL -H ldapi:\/\/\/ -b cn=config \"(objectClass=olcGlobal)\" olcLogLevel -LLL -Q<\/code><\/pre>\n\n\n\ndn: cn=config\nolcLogLevel: stats<\/code><\/pre>\n\n\n\nJournald is used for logging by default on Debian 12.<\/p>\n\n\n\n
To view the logs;<\/p>\n\n\n\n
journalctl -f -u slapd<\/code><\/pre>\n\n\n\nSample logs;<\/p>\n\n\n\n
\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 fd=12 ACCEPT from PATH=\/usr\/var\/run\/ldapi (PATH=\/usr\/var\/run\/ldapi)\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 op=0 BIND dn=\"\" method=163\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 op=0 BIND authcid=\"gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\" authzid=\"gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\"\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 op=0 BIND dn=\"gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\" mech=EXTERNAL bind_ssf=0 ssf=71\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 op=0 RESULT tag=97 err=0 qtime=0.000005 etime=0.000035 text=\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 op=1 SRCH base=\"cn=config\" scope=2 deref=0 filter=\"(objectClass=olcGlobal)\"\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 op=1 SRCH attr=olcLogLevel\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 op=1 SEARCH RESULT tag=101 err=0 qtime=0.000005 etime=0.000059 nentries=1 text=\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 op=2 UNBIND\nJul 07 12:24:18 ldapmaster.kifarunix-demo.com slapd[60837]: conn=1001 fd=12 closed\n<\/pre><\/code>\n\n\n\nIf you have enabled syslog logging<\/a> instead, you need to specify the log file for OpenLDAP on Rsyslog configuration. By default, OpenLDAP logs to local4<\/code> facility, hence, to configure it to log to \/var\/log\/slapd.log<\/code> for example, execute the command below;<\/p>\n\n\n\necho \"local4.* \/var\/log\/slapd.log\" >> \/etc\/rsyslog.d\/51-slapd.conf<\/code><\/pre>\n\n\n\nRestart Rsyslog and SLAPD service<\/p>\n\n\n\n
systemctl restart rsyslog slapd<\/code><\/pre>\n\n\n\nYou should now be able to read the LDAP logs on, \/var\/log\/slapd.log<\/code>.<\/p>\n\n\n\nYou can as well configure log rotation;<\/p>\n\n\n\n
\ncat > \/etc\/logrotate.d\/slapd << EOL\n\/var\/log\/slapd.log\n{ \n rotate 7\n daily\n missingok\n notifempty\n delaycompress\n compress\n postrotate\n \/usr\/lib\/rsyslog\/rsyslog-rotate\n endscript\n}\nEOL\n<\/code><\/pre>\n\n\n\nRestart log rotation service;<\/p>\n\n\n\n
systemctl restart logrotate<\/code><\/pre>\n\n\n\nCreate OpenLDAP Default Root DN<\/h4>\n\n\n\n
Next, create MDB database defining the root DN as well as the access control lists.<\/p>\n\n\n\n
First, generate the root DN password.<\/p>\n\n\n\n
slappasswd<\/code><\/pre>\n\n\n\nNew password: ENTER PASSWORD<\/strong>\nRe-enter new password: RE-ENTER PASSWORD<\/strong>\n{SSHA}7QP9kPALcQ+0RTlnc2S5dwLna3lJMwRf<\/strong><\/code><\/pre>\n\n\n\nCopy and paste the password hash generated above, {SSHA}7QP9kPALcQ+0RTlnc2S5dwLna3lJMwRf<\/strong>, as the value of olcRootPW<\/code><\/strong> in the Root DN ldif file below.<\/p>\n\n\n\nReplace the domain components, dc=ldapmaster,dc=kifarunix-demo,dc=com<\/strong><\/code> with your appropriate names.<\/p>\n\n\n\n\ncat > rootdn.ldif << 'EOL'\ndn: olcDatabase=mdb,cn=config\nobjectClass: olcDatabaseConfig\nobjectClass: olcMdbConfig\nolcDatabase: mdb\nolcDbMaxSize: 42949672960\nolcDbDirectory: \/var\/lib\/openldap\nolcSuffix: dc=ldapmaster,dc=kifarunix-demo,dc=com\nolcRootDN: cn=admin,dc=ldapmaster,dc=kifarunix-demo,dc=com\nolcRootPW: {SSHA}7QP9kPALcQ+0RTlnc2S5dwLna3lJMwRf\nolcDbIndex: uid pres,eq\nolcDbIndex: cn,sn pres,eq,approx,sub\nolcDbIndex: mail pres,eq,sub\nolcDbIndex: objectClass pres,eq\nolcDbIndex: loginShell pres,eq\nolcDbIndex: sudoUser,sudoHost pres,eq\nolcAccess: to attrs=userPassword,shadowLastChange,shadowExpire\n by self write\n by anonymous auth\n by dn.subtree=\"gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\" manage \n by dn.subtree=\"ou=system,dc=ldapmaster,dc=kifarunix-demo,dc=com\" read\n by * none\nolcAccess: to dn.subtree=\"ou=system,dc=ldapmaster,dc=kifarunix-demo,dc=com\" by dn.subtree=\"gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\" manage\n by * none\nolcAccess: to dn.subtree=\"dc=ldapmaster,dc=kifarunix-demo,dc=com\" by dn.subtree=\"gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\" manage\n by users read \n by * none\nEOL\n<\/code><\/pre>\n\n\n\nRead more about ACL on OpenLDAP Access Control<\/a>.<\/p>\n\n\n\nUpdate the slapd database with the content above;<\/p>\n\n\n\n
ldapadd -Y EXTERNAL -H ldapi:\/\/\/ -f rootdn.ldif<\/code><\/pre>\n\n\n\nSample command output;<\/p>\n\n\n\n
SASL\/EXTERNAL authentication started\nSASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth\nSASL SSF: 0\nadding new entry \"olcDatabase=mdb,cn=config\"<\/code><\/pre>\n\n\n\nTo secure OpenLDAP communication between the client and the server, configured it to use SSL\/TLS certificates.<\/p>\n\n\n\n
In this guide, we are using self-signed certificates. You can choose to obtain the commercially signed and trusted certificates from your preferred CAs, for production environments.<\/p>\n\n\n\n
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \\\n\/etc\/ssl\/ldapserver.key -out \/etc\/ssl\/ldapserver.crt<\/code><\/pre>\n\n\n\nchown ldap:ldap \/etc\/ssl\/{ldapserver.crt,ldapserver.key}<\/code><\/pre>\n\n\n\nUpdate the OpenLDAP Server TLS certificates attributes.<\/p>\n\n\n\n
\ncat > tls.ldif << 'EOL'\ndn: cn=config\nchangetype: modify\nadd: olcTLSCACertificateFile\nolcTLSCACertificateFile: \/etc\/ssl\/ldapserver.crt\n-\nadd: olcTLSCertificateFile\nolcTLSCertificateFile: \/etc\/ssl\/ldapserver.crt\n-\nadd: olcTLSCertificateKeyFile\nolcTLSCertificateKeyFile: \/etc\/ssl\/ldapserver.key\nEOL\n<\/code><\/pre>\n\n\n\nNote that we have used self-signed certificate as both the certificate and the CA certificate.<\/p>\n\n\n\n