directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject [directory-ldap-api] branch master updated: DIRAPI-374: Consistify LdapConnectionConfig useTls and useSsl flags
Date Sat, 19 Jun 2021 20:28:35 GMT
This is an automated email from the ASF dual-hosted git repository.

seelmann 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 bf32f0e  DIRAPI-374: Consistify LdapConnectionConfig useTls and useSsl flags
bf32f0e is described below

commit bf32f0e902ffb08839defcaf3c1de5164d83e092
Author: Stefan Seelmann <mail@stefan-seelmann.de>
AuthorDate: Sat Jun 19 22:28:22 2021 +0200

    DIRAPI-374: Consistify LdapConnectionConfig useTls and useSsl flags
---
 .../directory/ldap/client/api/LdapNetworkConnection.java   | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 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 08b9395..c5d7c59 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
@@ -996,7 +996,13 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements
Lda
             messageId.set( 0 );
             
             connectionCloseFuture = new CompletableFuture<>();
-    
+
+            // establish TLS layer if TLS is enabled and SSL is NOT
+            if ( config.isUseTls() && !config.isUseSsl() )
+            {
+                startTls();
+            }
+
             // And return
             return true;
         }
@@ -1623,12 +1629,6 @@ public class LdapNetworkConnection extends AbstractLdapConnection implements
Lda
         // try to connect, if we aren't already connected.
         connect();
 
-        // establish TLS layer if TLS is enabled and SSL is NOT
-        if ( config.isUseTls() && !config.isUseSsl() )
-        {
-            startTls();
-        }
-
         // If the session has not been establish, or is closed, we get out immediately
         checkSession();
 

Mime
View raw message