changeset 7345:0c7dc0b0bb7b HEAD

Fail with a clear error if both tls=yes and ldaps:// URI is used.
author Timo Sirainen <tss@iki.fi>
date Wed, 05 Mar 2008 01:11:00 +0200
parents 57ae4181bb32
children 393abdd250bb
files src/auth/db-ldap.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/db-ldap.c	Wed Mar 05 00:57:17 2008 +0200
+++ b/src/auth/db-ldap.c	Wed Mar 05 01:11:00 2008 +0200
@@ -760,6 +760,11 @@
 #ifdef LDAP_HAVE_START_TLS_S
 		ret = ldap_start_tls_s(conn->ld, NULL, NULL);
 		if (ret != LDAP_SUCCESS) {
+			if (ret == LDAP_OPERATIONS_ERROR &&
+			    strncmp(conn->set.uris, "ldaps:", 6) == 0) {
+				i_fatal("LDAP: Don't use both tls=yes "
+					"and ldaps URI");
+			}
 			i_error("LDAP: ldap_start_tls_s() failed: %s",
 				ldap_err2string(ret));
 			return -1;