Administration
LDAP settings

LDAPS setup

12min

When using LDAPS, you need to explicitly specify the ldaps:// protocol at the beginning of the host name, for example:

$ldaphost="ldaps://passwork.local:636";

For LDAPS to work, your OS should have trusted certificates of the CA (certificate authority) that issued the LDAPS server certificate.



Installing certificates

Certificates must be in the .crt format

Ubuntu/Debian

1. Allow dynamic configuration of the trust store:

Shell


2. Place the LDAPS server certificate in the following directory:

Shell


3. Update the trust store:

Shell


CentOS

1. Allow dynamic configuration of the trust store:

Shell


2. Place the LDAPS server certificate in the /etc/pki/ca-trust/source/anchors/ directory:

Shell


3. Update the trust store:

Shell


Docker

To make a root LDAPS certificate a trusted one, you need to copy a .pem or .crt certificate into ./conf/custom_ca and restart the PHP container:

Shell


Windows

PHP for Windows uses its own certificate store. As such, if Passwork is installed on a Windows Server, the PHP module responsible for LDAP will not accept the LDAP server certificate, even if it has been added to the Windows trusted certificate store.

For PHP to accept the certificate, you need to:

  1. Create an openldap folder in your system root directory
  2. Create a sysconf folder in the openldap folder
  3. Create a ldap.conf file in the sysconf folder with the following lines:
Windows


Where TLS_CACERT is the path to your certificate.

Make sure that the certificate is in base64 format. When opening a certificate file with notepad, you will see the certificate's hash. If the format is different, you need to export the required root certificate in base64.



LDAPS debugging

To test for possible certificate issues during connection, execute the following command:

Shell


To verify the certificates, execute the following command:

Shell

  • Use the -CAfile directive to specify the certificate of the CA that issued the LDPAS server certificate
  • Use the -untrusted directive to specify the LDAPS server certificate and the certificates of intermediate servers in the chain (if you have them)



Updated 03 Sep 2024
Doc contributor
Doc contributor
Did this page help you?