Hi,

I'm new to Net::LDAP and want to use it to acess an OpenLDAP server that
accepts simple authentication over TLS. TLSVerifyClient is set to 'never' on
the server.

Using  the openldap package ldapsearch establishes a tls connection and
searches the ldap directory as expected.

My simple perl script however fails with "TLS confidentiality required
error". The script is as follows:

#!/usr/bin/perl -w
use Net::LDAP;

$ldap = Net::LDAP->new( 'localhost' ) or die "$@";

$mesg = $ldap->start_tls( verify => 'none', );
$mesg->code && die $mesg->error;

$mesg = $ldap->bind("cn=ldapmin,dc=castle,dc=org",
                         password => "secret", version => 3 ) ;
$mesg->code && die $mesg->error;

$mesg = $ldap->search ( base   => "ou=People,dc=castle,dc=org",
                         filter => "(cn=Prime User)", );
$mesg->code && die $mesg->error;

$mesg = $ldap->unbind;



When tls support is turned off on the server, the script (without the
start_tls() method) works ok.

Am I using start_tls() incorrectly ? Any ideas would be appreciated.

Thanks

Hans

Reply via email to