Subject: | LWP does not work with LDAPS queries. |
Currently, Net::LDAP has full support for LDAPS, but not using LWP. LWP
can parse ldaps URL, but can not execute.
The small ldaps.pm module (below) will provide support for ldaps.
Also, ldap.pm need to be modified to pass the scheme to the Net::LDAP.
my $scheme = $url->scheme ;
# WAS: if ( $url->scheme ne 'ldap' ) {
if ($scheme ne 'ldap' && $scheme ne 'ldaps' ) {
my $scheme = $url->scheme;
return new HTTP::Response &HTTP::Status::RC_INTERNAL_SERVER_ERROR,
"LWP::Protocol::ldap::request called for '$scheme'";
}
...
# Object creation modified to support ldaps or ldap.
# WAS: my $ldap = new Net::LDAP($host, port => $port);
my $ldap = new Net::LDAP("$scheme://$host/", port => $port);
=== LWP/Protocol/ldaps.pm:
package LWP::Protocol::ldaps;
use strict ;
use base 'LWP::Protocol::ldap' ;
1;