每次运行此脚本时,我都会收到“错误的文件描述符”,并将'verify'设置为'require':
#!/usr/bin/perl
use warnings;
use strict;
use Net::LDAP;
use Data::Dumper;
my $ldap = Net::LDAP->new( '123.com' ) or die "$@";
my $mesg = $ldap->start_tls( verify => 'require',
capath => '/etc/openldap/rod/5e5a5bcb.0'
sslversion => 'sslv3',
);
$mesg = $ldap->bind('cn=manager,dc=wh,dc=local', password => '12345');
print Dumper($mesg);
但是当我将'verify'设置为'none'时,我没有得到'Bad File Descriptor'。
这是我的输出:
$VAR1 = bless( {
'resultCode' => 82,
'parent' => bless( {
'net_ldap_version' => 3,
'net_ldap_scheme' => 'ldap',
'net_ldap_debug' => 0,
'net_ldap_socket' => bless( \*Symbol::GEN0, 'IO::Socket::INET' ),
'net_ldap_host' => 'fl1-lsh99apa006.securesites.com',
'net_ldap_uri' => 'fl1-lsh99apa006.securesites.com',
'net_ldap_resp' => {},
'net_ldap_mesg' => {},
'net_ldap_async' => 0,
'net_ldap_port' => 389,
'net_ldap_refcnt' => 1
}, 'Net::LDAP' ),
'callback' => undef,
'mesgid' => 2,
'pdu' => '0,`\'cn=manager,dc=wh,dc=local123456',
'errorMessage' => 'Bad file descriptor',
'raw' => undef
}, 'Net::LDAP::Bind' );
但是看看有pdu的那条线。
cn=manager,dc=wh,dc=local123456
它将密码附加到bindstring。
非常感谢任何帮助。