LDAPS: list availability depending on SSL's presence
authorHoward Chu <hyc@highlandsun.com>
Fri, 28 May 2010 10:23:28 +0000 (12:23 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 28 May 2010 10:23:28 +0000 (12:23 +0200)
configure.ac
lib/url.c
lib/version.c

index b0bc91c..774fd95 100644 (file)
@@ -864,6 +864,7 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
     curl_ldap_msg="enabled (OpenLDAP)"
     if test "x$ac_cv_func_ldap_init_fd" = x""yes; then
       AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
+      AC_SUBST(USE_OPENLDAP, [1])
     fi
   fi
 fi
@@ -2700,11 +2701,11 @@ fi
 if test "x$CURL_DISABLE_TELNET" != "x1"; then
   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
 fi
-if test "x$CURL_DISABLE_LDAP" != "x1"; then
+if test "x$CURL_DISABLE_LDAP" != "x1" -o "x$USE_OPENLDAP" = "x1"; then
   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
-fi
-if test "x$CURL_DISABLE_LDAPS" != "x1"; then
-  SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
+  if test "x$CURL_DISABLE_LDAPS" != "x1" -o "x$USE_OPENLDAP$SSL_ENABLED" = "x11"; then
+    SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
+  fi
 fi
 if test "x$CURL_DISABLE_DICT" != "x1"; then
   SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
index 8f95c8a..4d1632b 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -183,7 +183,7 @@ static const struct Curl_handler * const protocols[] = {
 
 #if !defined(CURL_DISABLE_LDAP) || defined(USE_OPENLDAP)
   &Curl_handler_ldap,
-#if defined(HAVE_LDAP_SSL) || defined(USE_OPENLDAP)
+#if defined(HAVE_LDAP_SSL) || (defined(USE_OPENLDAP) && defined(USE_SSL))
   &Curl_handler_ldaps,
 #endif
 #endif
index f9cc1f7..d482bff 100644 (file)
@@ -172,7 +172,7 @@ static const char * const protocols[] = {
 #endif
 #if !defined(CURL_DISABLE_LDAP) || defined(USE_OPENLDAP)
   "ldap",
-#if defined(HAVE_LDAP_SSL) || defined(USE_OPENLDAP)
+#if defined(HAVE_LDAP_SSL) || (defined(USE_OPENLDAP) && defined(USE_SSL))
   "ldaps",
 #endif
 #endif