talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 174c03f1931636ba6a47415619c18ce5af572d69
parent 49352499f77080f456760a90686f1e97dca51283
Author: Ricardo Mones <ricardo@mones.org>
Date:   Mon, 18 Dec 2017 21:20:25 +0100

Fix Bug 3936: LDAP StartTLS does not work for addressbooks

Diffstat:
Msrc/ldapserver.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/ldapserver.c b/src/ldapserver.c @@ -764,9 +764,10 @@ LDAP *ldapsvr_connect(LdapControl *ctl) { cm_return_val_if_fail(ctl != NULL, NULL); ldapsrv_set_options (ctl->timeOut, NULL); - uri = g_strdup_printf("ldap%s://%s:%d", - (ctl->enableSSL || ctl->enableTLS)?"s":"", - ctl->hostName, ctl->port); + if (ctl->enableSSL) + uri = g_strdup_printf("ldaps://%s:%d", ctl->hostName, ctl->port); + else + uri = g_strdup_printf("ldap://%s:%d", ctl->hostName, ctl->port); #ifdef G_OS_UNIX ldap_initialize(&ld, uri); #else