spring-ldap
spring-ldap copied to clipboard
doGetContext should use returned DirContext processContextAfterCreation
to enable the startTLS to close the session.
One may want to use a org.springframework.ldap.core.support.AbstractTlsDirContextAuthenticationStrategy as authenticationStrategy, and set its shutdownTlsGracefully flag to true. Now, calling authenticationStrategy.processContextAfterCreation from doGetContext should return a proxy DirContext which will hold a TlsAwareDirContextProxy with the ldap context he had opend. calling to 'close' of the contex whould now call also to 'close' of the ldap context. (This is needed when using ldap protocol with startTls. Some configurations reqiers the caller to shutdown Tls gracefully) The returned DirContext proxy is now the one to be returned from doGetContext, and not ignored as before.
I have this fix for it: https://github.com/AmirWiener/spring-ldap/pull/1