Need to modification to enable TLSv1.2

In case the script just fails with CRITICAL and no error msg, it is because $ldap has not be created due to SSL cipher negociation problem.

Patch below fixes the issue:

— check_ldap.pl.orig 2024-11-01 09:43:44.616030489 +0100
+++ check_ldap.pl 2024-11-01 09:43:51.356022937 +0100
@@ -113,9 +113,9 @@
}
} else {
if (defined($o_port)) {
– $ldap = Net::LDAPS->new( $o_host, port => $o_port, version => 3, timeout => $o_timeout );
+ $ldap = Net::LDAPS->new( $o_host, port => $o_port, version => 3, timeout => $o_timeout, sslversion => ‘tlsv1_2’ );
} else {
– $ldap = Net::LDAPS->new( $o_host, port => $o_ldaps_port, version => 3, timeout => $o_timeout );
+ $ldap = Net::LDAPS->new( $o_host, port => $o_ldaps_port, version => 3, timeout => $o_timeout, sslversion => ‘tlsv1_2’ );
}
}