]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Allow the build of digest_ldap_auth when ldap_start_tls_s() is not available
authorserassio <>
Sat, 22 Sep 2007 23:35:28 +0000 (23:35 +0000)
committerserassio <>
Sat, 22 Sep 2007 23:35:28 +0000 (23:35 +0000)
helpers/digest_auth/ldap/ldap_backend.c

index ba2ccaaf48235912d9318e1a07bb16cc5a8d212a..4594a610ec7f25cc1eaa4927de96ca011c126feb 100644 (file)
@@ -359,10 +359,18 @@ ldapconnect(void)
            ldap_unbind(ld);
            ld = NULL;
        }
-       if (use_tls && (version == LDAP_VERSION3) && (ldap_start_tls_s(ld, NULL, NULL) == LDAP_SUCCESS)) {
-           fprintf(stderr, "Could not Activate TLS connection\n");
+       if (use_tls) {
+#ifdef LDAP_OPT_X_TLS
+           if ((version == LDAP_VERSION3) && (ldap_start_tls_s(ld, NULL, NULL) == LDAP_SUCCESS)) {
+               fprintf(stderr, "Could not Activate TLS connection\n");
+               ldap_unbind(ld);
+               ld = NULL;
+           }
+#else
+           fprintf(stderr, "TLS not supported with your LDAP library\n");
            ldap_unbind(ld);
            ld = NULL;
+#endif
        }
 #endif
        squid_ldap_set_timelimit(timelimit);