#344422 smbldap-tools: LDAP + SSL not working

#344422#5
Date:
2005-12-22 16:33:21 UTC
From:
To:
Hi,

I added/change the following to use LDAP + SSL:

use Net::LDAPS;

       if (($config{ldapSSL} != 1) and ($config{ldapTLS} != 1)) {
        print "re\n";
        $ldap_master = Net::LDAP->new(
                "$config{masterLDAP}",
                port => "$config{masterPort}",
                )
                or die "LDAP error: Can't contact master ldap server ($@)";
        }
        if ($config{ldapSSL} eq "1") {
        $ldap_master = Net::LDAPS->new(
                "$config{masterLDAPS}",
                port => "$config{masterPort}",
                verify => "$config{verify}",
                cafile => "$config{cafile}"
                )
                or die "LDAP error: Can't contact master ldap server with SSL ($@)";
        }

with in /etc/smbldap-tools/smbldap.conf
masterLDAPS="ldaps://myldapserver/"

Thanks,
Yann

#344422#10
Date:
2005-12-22 17:08:41 UTC
From:
To:
El Thu, Dec 22, 2005 at 05:33:21PM +0100, Yann Forget va escriure:

What you have sent is not a patch, so I don't really know what I'm
supposed to do with it... what is not working? where is the code you have sent
supposed to go?

Greetings,

  Sergio.

#344422#15
Date:
2008-01-25 03:19:07 UTC
From:
To:
The problem with smbldap-tools is that it cannot connect to a ldap server
that doesn't run in unencrypted mode at all. I wanted to run slapd with -h
ldaps:/// only. smbldap-tools are unable to connect to it.
Unfortunately I don't know perl at all. But afaict the code snippet from the
original bug report should go somewhere in smbldap_tools.pm. I'd be very
glad if someone that knows perl could have another look at it.
Thanks, Jonas

#344422#20
Date:
2010-04-20 13:08:26 UTC
From:
To:
Hi,

I had problem with smbldap-tools (version 0.9.4-1 on Debian Lenny) too, when
I tried to use it with tls/ldaps. I wanted to use smbldap-tools towards a
server, where only ldaps connection is available from outside, on port 636
(locally I use port 389 without tls).
I tried the ldapTLS="1" parameter, but I got the error message:
Can't contact LDAP server at /usr/share/perl5/smbldap_tools.pm line 801.
 It turned out that in smbldap-tools.pm the Net::LDAP->new doesn't use the
scheme parameter. When I added
scheme="ldaps"
ldapTLS="0"
to the smbldap.conf, and
scheme => "$config{scheme}"
to the LDAP initialization (every occurence) in smbldap-tools.pm, it worked.
In this case, with ldapTLS="1", I got a warning, but worked too.

Greetings,

Tamas.