From: serassio <> Date: Sat, 22 Sep 2007 23:35:28 +0000 (+0000) Subject: Allow the build of digest_ldap_auth when ldap_start_tls_s() is not available X-Git-Tag: SQUID_3_0_RC1~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e11ffec305e6d947cbe8ed9dd766258f7793a020;p=thirdparty%2Fsquid.git Allow the build of digest_ldap_auth when ldap_start_tls_s() is not available --- diff --git a/helpers/digest_auth/ldap/ldap_backend.c b/helpers/digest_auth/ldap/ldap_backend.c index ba2ccaaf48..4594a610ec 100644 --- a/helpers/digest_auth/ldap/ldap_backend.c +++ b/helpers/digest_auth/ldap/ldap_backend.c @@ -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);