Works on old LWP::UserAgent
This commit is contained in:
parent
0e22becfb6
commit
3678b13055
4 changed files with 59 additions and 5 deletions
|
|
@ -40,7 +40,11 @@ sub parse($$)
|
|||
|
||||
my $sax_handler;
|
||||
$sax_handler = ResultHandler->new($parsed) if ($mod eq "ResultHandler");
|
||||
return XML::LibXML->load_xml(string => shift) if ($mod eq "ProjectHandler");
|
||||
if ($mod eq "ProjectHandler")
|
||||
{
|
||||
use ACU::Project;
|
||||
$sax_handler = ProjectHandler->new($parsed);
|
||||
}
|
||||
$sax_handler = ProjectMemberHandler->new($parsed) if ($mod eq "ProjectMemberHandler");
|
||||
|
||||
my $parser = XML::SAX::ParserFactory->parser( Handler => $sax_handler );
|
||||
|
|
@ -71,7 +75,10 @@ sub get($$)
|
|||
my $url = shift;
|
||||
my $ua = LWP::UserAgent->new;
|
||||
|
||||
$ua->ssl_opts(SSL_ca_file => "/etc/ldap/cacert.pem");
|
||||
# Some old version of LWP::UserAgent doesn't support ssl_opts, this is not required
|
||||
eval {
|
||||
$ua->ssl_opts(SSL_ca_file => "/etc/ldap/cacert.pem");
|
||||
};
|
||||
|
||||
log(DEBUG, 'GET Request to ', API_URL, $url);
|
||||
my $req = GET API_URL . $url;
|
||||
|
|
@ -89,7 +96,10 @@ sub send($$$)
|
|||
my $url = shift;
|
||||
my $ua = LWP::UserAgent->new;
|
||||
|
||||
$ua->ssl_opts(SSL_ca_file => "/etc/ldap/cacert.pem");
|
||||
# Some old version of LWP::UserAgent doesn't support ssl_opts, this is not required
|
||||
eval {
|
||||
$ua->ssl_opts(SSL_ca_file => "/etc/ldap/cacert.pem");
|
||||
};
|
||||
|
||||
log(DEBUG, 'POST Request to ', API_URL, $url);
|
||||
my $req = POST API_URL . $url, shift;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ my $bindsecret = "";
|
|||
|
||||
sub ldap_get_password
|
||||
{
|
||||
return Password::get_password "/home/intradmin/.secret_ldap";
|
||||
return Password::get_password "/home/2014/mercie_d/.secret_ldap";
|
||||
# return Password::get_password "/home/intradmin/.secret_ldap";
|
||||
}
|
||||
|
||||
our $secret_search = \&ldap_get_password;
|
||||
|
|
|
|||
Reference in a new issue