From: hno <> Date: Sun, 11 Sep 2005 07:02:33 +0000 (+0000) Subject: Bug #1389: LDAP helpers does not wotk with TLS (-Z option) X-Git-Tag: SQUID_3_0_PRE4~639 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f988d08e657c89920167d55627d92011feb6910c;p=thirdparty%2Fsquid.git Bug #1389: LDAP helpers does not wotk with TLS (-Z option) --- diff --git a/helpers/basic_auth/LDAP/squid_ldap_auth.c b/helpers/basic_auth/LDAP/squid_ldap_auth.c index 263a97021c..8e1a32aebb 100644 --- a/helpers/basic_auth/LDAP/squid_ldap_auth.c +++ b/helpers/basic_auth/LDAP/squid_ldap_auth.c @@ -293,12 +293,12 @@ open_ldap_connection(const char *ldapServer, int port) } 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"); - exit(1); - } else { + if (version != LDAP_VERSION3) { fprintf(stderr, "TLS requires LDAP version 3\n"); exit(1); + } else if(ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) { + fprintf(stderr, "Could not Activate TLS connection\n"); + exit(1); } #else fprintf(stderr, "TLS not supported with your LDAP library\n"); diff --git a/helpers/external_acl/ldap_group/squid_ldap_group.c b/helpers/external_acl/ldap_group/squid_ldap_group.c index d5209438b0..92baedd893 100644 --- a/helpers/external_acl/ldap_group/squid_ldap_group.c +++ b/helpers/external_acl/ldap_group/squid_ldap_group.c @@ -528,14 +528,14 @@ main(int argc, char **argv) } if (use_tls) { #ifdef LDAP_OPT_X_TLS - if (version == LDAP_VERSION3 && ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) { + if (version != LDAP_VERSION3) { + fprintf(stderr, "TLS requires LDAP version 3\n"); + exit(1); + } else if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) { fprintf(stderr, "Could not Activate TLS connection\n"); ldap_unbind(ld); ld = NULL; break; - } else { - fprintf(stderr, "TLS requires LDAP version 3\n"); - exit(1); } #else fprintf(stderr, "TLS not supported with your LDAP library\n");