]> granicus.if.org Git - apache/commitdiff
Fix a problem where SSL was started twice when no client certificates were
authorGraham Leggett <minfrin@apache.org>
Thu, 20 Jan 2005 08:15:46 +0000 (08:15 +0000)
committerGraham Leggett <minfrin@apache.org>
Thu, 20 Jan 2005 08:15:46 +0000 (08:15 +0000)
specified.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@125733 13f79535-47bb-0310-9956-ffa450edef68

modules/ldap/util_ldap.c

index 53435dcf802db34f8d1efa5687777534df4af70c..55f8b007bd52d378d62babffe23b97a72ffb5084 100644 (file)
@@ -310,14 +310,17 @@ LDAP_DECLARE(int) util_ldap_connection_open(request_rec *r,
         }
 
         /* switch on SSL/TLS */
-        apr_ldap_set_option(ldc->pool, ldc->ldap, 
-                            APR_LDAP_OPT_TLS, &ldc->secure, &(result));
-        if (LDAP_SUCCESS != result->rc) {
-            ldap_unbind_s(ldc->ldap);
-            ldc->ldap = NULL;
-            ldc->bound = 0;
-            ldc->reason = result->reason;
-            return(result->rc);
+        if (!apr_is_empty_array(ldc->client_certs)) {
+
+            apr_ldap_set_option(ldc->pool, ldc->ldap, 
+                                APR_LDAP_OPT_TLS, &ldc->secure, &(result));
+            if (LDAP_SUCCESS != result->rc) {
+                ldap_unbind_s(ldc->ldap);
+                ldc->ldap = NULL;
+                ldc->bound = 0;
+                ldc->reason = result->reason;
+                return(result->rc);
+            }
         }
 
         /* Set the alias dereferencing option */