我試圖使用Net :: LDAPS模塊連接到LDAP服務器。我將正確的用戶名,密碼和capath傳遞給它。同一版本中的所有模塊的相同代碼適用於其他機器之一。但在這臺特定的機器上,我看到了這個錯誤。Net :: LDAPS在SSL連接期間拋出未知錯誤
我一起工作的示例代碼:
my $ad_host = 'XYZ';
my $ad_port = 636;
my $ad_user = 'ABC';
my $ad_pass = '****';
my $ca_path = '<path to ca cert>';
my $ldap = Net::LDAPS->new(
$ad_host,
port => $ad_port,
verify => 'require',
capath => $ca_path
);
難道是LDAPS模塊中的一個已知的bug?或者我錯過了一些明顯的東西。
的調試日誌:模塊
DEBUG: .../IO/Socket/SSL.pm:179: set domain to 2
DEBUG: .../IO/Socket/SSL.pm:1427: new ctx 21295632
DEBUG: .../IO/Socket/SSL.pm:309: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:311: socket connected
DEBUG: .../IO/Socket/SSL.pm:324: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:354: set socket to non-blocking to enforce timeout=120
DEBUG: .../IO/Socket/SSL.pm:367: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:377: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:387: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:407: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:367: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:377: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:387: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:407: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:367: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:1175: SSL connect attempt failed with unknown error..error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DEBUG: .../IO/Socket/SSL.pm:373: fatal SSL error: SSL connect attempt failed with unknown error..error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DEBUG: .../IO/Socket/SSL.pm:1462: free ctx 21295632 open=21295632
DEBUG: .../IO/Socket/SSL.pm:1465: OK free ctx 21295632
DEBUG: .../IO/Socket/SSL.pm:1175: IO::Socket::INET6 configuration failederror:00000000:lib(0):func(0):reason(0)
版本我使用:
...:〜/ test_perl $ perlmodver的Net :: LDAPS 0.05
...: 〜/ test_perl $ perlmodver Net :: LDAP 0.39
...:〜/ test_perl $ perlmodver IO :: Socket :: SSL 1.18
您可以使用ldapsearch連接到您的服務器嗎? –
您正在使用8年前版本的模塊。目前有所有這些模塊的版本。你嘗試過這些嗎? –
@ChankeyPathak我可以通過telnet連接到我的AD機器上的端口636。另外,相同的perl腳本在類似的機器上運行完美,所有模塊都是相同的。 – user1726707