0
votes

We developed a Java application to integrate LDAP users using Spring. It works when the application connects the LDAP server on LDAP(ldap://openldap:389). I am facing a problem when connecting the LDAP server over TLS(ldaps://openldap:636).

Environment:

TurnKey Open Ldap server VM is installed

A new self-signed certificate is generated. It is used at both the java app and LDAP server

Exception:

Caused by: org.springframework.ldap.CommunicationException: simple bind failed: openldap:636; nested exception is javax.naming.CommunicationException: simple bind failed: openldap:636 [Root exception is javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching openldap found]

The following exception is thrown when a built-in certificate bundled in Turnkey Open Ldap VM is used at java app

org.springframework.ldap.CommunicationException: simple bind failed: openldap:636; nested exception is javax.naming.CommunicationException: simple bind failed: openldap:636 [Root exception is java.net.SocketException: Connection or outbound has closed]

1

1 Answers

0
votes

This is root certificate issue. I imported wrong CA certificate into cacerts. Root cause is we looked wrong location for certificate configuration in TurnKey open ldap. The certificates found in /etc/ldap/tls, but we looked wrongly at /etc/ssl/private

It works after importing ca_cert.pem from /etc/ldap/tls into cacerts at client side.