You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2018/07/02 10:34:38 UTC

[directory-ldap-api] branch master updated: o Fixed a bug in the startTLS handling : teh SslFilter was not added into the chain o Fixed the timeout setting

This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git


The following commit(s) were added to refs/heads/master by this push:
     new e05fe64  o Fixed a bug in the startTLS handling : teh SslFilter was not added into the chain o Fixed the timeout setting
e05fe64 is described below

commit e05fe649e2da4dcbe3bfb19d1578bc297b28a636
Author: Emmanuel Lécharny <el...@symas.com>
AuthorDate: Mon Jul 2 12:34:35 2018 +0200

    o Fixed a bug in the startTLS handling : teh SslFilter was not added
    into the chain
    o Fixed the timeout setting
---
 .../org/apache/directory/ldap/client/api/LdapNetworkConnection.java  | 5 ++++-
 .../api/ldap/codec/protocol/mina/LdapProtocolCodecActivator.java     | 1 -
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java b/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
index c85e209..f8ea811 100644
--- a/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
+++ b/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
@@ -290,6 +290,8 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements Lda
         {
             config.setBinaryAttributeDetector( new DefaultConfigurableBinaryAttributeDetector() );
         }
+        
+        this.timeout = config.getTimeout();
     }
 
 
@@ -665,7 +667,6 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements Lda
         SocketAddress address = new InetSocketAddress( config.getLdapHost(), config.getLdapPort() );
 
         // And create the connection future
-        timeout = config.getTimeout();
         long maxRetry = System.currentTimeMillis() + timeout;
         ConnectFuture connectionFuture = null;
         boolean interrupted = false;
@@ -4682,6 +4683,8 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements Lda
             else
             // for StartTLS
             {
+                ldapSession.getFilterChain().addFirst( SSL_FILTER_KEY, sslFilter );
+                
                 boolean isSecured = handshakeFuture.get( timeout, TimeUnit.MILLISECONDS );
                 
                 if ( !isSecured )
diff --git a/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecActivator.java b/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecActivator.java
index c2bbe65..2aa77db 100644
--- a/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecActivator.java
+++ b/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolCodecActivator.java
@@ -36,7 +36,6 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer;
  */
 public class LdapProtocolCodecActivator implements BundleActivator
 {
-
     private ServiceTracker<LdapApiService, LdapApiService> serviceTracker;
 
     class LdapApiServiceTracker implements ServiceTrackerCustomizer<LdapApiService, LdapApiService>