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/04/20 22:09:07 UTC

[directory-ldap-api] branch 1.0.1 updated: More fixes...

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

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


The following commit(s) were added to refs/heads/1.0.1 by this push:
     new 5eb957f  More fixes...
5eb957f is described below

commit 5eb957f5d72e0bb3375997a902a420f4a8e12b4a
Author: Emmanuel Lécharny <el...@symas.com>
AuthorDate: Sat Apr 21 00:08:44 2018 +0200

    More fixes...
---
 .../directory/ldap/client/api/LdapNetworkConnection.java     | 12 ++++++------
 1 file changed, 6 insertions(+), 6 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 422d121..c63158f 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
@@ -2027,7 +2027,7 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements Lda
         if ( message instanceof SslFilter.SslFilterMessage )
         {
             // This is a SSL message telling if the session has been secured or not
-            HandshakeFuture handshakeFuture = ( HandshakeFuture ) ldapSession.getAttribute( "HANDSHAKE_FUTURE" );
+            HandshakeFuture handshakeFuture = ( HandshakeFuture ) session.getAttribute( "HANDSHAKE_FUTURE" );
 
             if ( message == SslFilter.SESSION_SECURED )
             {
@@ -2040,7 +2040,8 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements Lda
                 handshakeFuture.cancel();
             }
 
-            ldapSession.removeAttribute( "HANDSHAKE_FUTURE" );
+            session.removeAttribute( "HANDSHAKE_FUTURE" );
+            
             return;
         }
 
@@ -4070,11 +4071,10 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements Lda
             // for StartTLS
             {
                 HandshakeFuture handshakeFuture = new HandshakeFuture();
-                
+
                 ldapSession.setAttribute( SslFilter.USE_NOTIFICATION, Boolean.TRUE );
                 ldapSession.setAttribute( "HANDSHAKE_FUTURE", handshakeFuture );
                 ldapSession.getFilterChain().addFirst( SSL_FILTER_KEY, sslFilter );
-
                 boolean isSecured = handshakeFuture.get( timeout, TimeUnit.MILLISECONDS );
                 
                 if ( !isSecured )
@@ -4276,11 +4276,11 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements Lda
     {
         // If we are meant to be using a secure connection but the ssl filter isn' in the filter chain then
         // throw immediately
-        if ( config.isUseSsl() && !ldapSession.isSecured() )
+        if ( config.isUseSsl() && !ldapSession.getFilterChain().contains( "sslFilter" ) )
         {
             throw new InvalidConnectionException( "Attempting to send over an insecure connection" );
         }
-
+        
         // Send the request to the server
         WriteFuture writeFuture = ldapSession.write( request );
 

-- 
To stop receiving notification emails like this one, please contact
elecharny@apache.org.