Ldap – Postgresql with ldaps:/// url on port 636

ldapopenldappostgresql

Is it possible to connect postgres' LDAP authentication to the SSL (ldaps://) port 636 of an LDAP server (eg, openldap)?

It appears that it can use StartTLS on the regular 389 port, but is it possible to use ldaps (SSL)?

Best Answer

LDAPS is only supported since PostgreSQL 11. An example pg_hba.conf entry:

hostssl all all 192.168.0.1/24 ldap ldapserver=dc2.ad.foobar.com ldapport=636 ldapscheme=ldaps ldaptls=0 ldapbinddn="CN=ldap,OU=Helpers,OU=Foobar,DC=ad,DC=foobar,DC=com" ldapbindpasswd=*** ldapsearchattribute=mail ldapbasedn="OU=Users,OU=Foobar,DC=ad,DC=foobar,DC=com"

A complete guide: PostgreSQL 11 with Active Directory over SSL on CentOS 7