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]