Skip to content

Using custom truststore more complicated than necessary #494

@marschall

Description

@marschall

We want to use Spring LDAP with a custom truststore because we want to use LDAPS and truststore with only the CA certificate of the LDAP servers. We do not want to configure a truststore globally, we are using and following LDAP referrals.

We were initially using a DefaultTlsDirContextAuthenticationStrategy and configuring the sslSocketFactory property. We found that was not enough. We only got it working by setting the java.naming.ldap.factory.socket property. This required us to:

  • implement a custom SSLSocketFactory
  • implement a custom SimpleDirContextAuthenticationStrategy that sets the java.naming.ldap.factory.socket property in the #setupEnvironment(Hashtable, String, String) method.
  • implement a custom DefaultSpringSecurityContextSource that in sets the java.naming.ldap.factory.socket property in the #getAuthenticatedEnv(String, String) method

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions