Merge branch '2716-ue-plugin-modifications' into 'develop'

Improved LWP ssl ignore certificate added extra debug

See merge request artica/pandorafms!1723
This commit is contained in:
vgilc 2018-10-31 16:00:46 +01:00
commit e3f6a794a4
1 changed files with 12 additions and 0 deletions

View File

@ -936,7 +936,10 @@ sub call_url {
if ($response->is_success){
return $response->decoded_content;
} elsif (!empty($response->{'_msg'})) {
print_stderror($conf, 'Failed: ' . $response->{'_msg'});
}
return undef;
}
@ -958,7 +961,10 @@ sub post_url {
if ($response->is_success){
return $response->decoded_content;
} elsif (!empty($response->{'_msg'})) {
print_stderror($conf, 'Failed: ' . $response->{'_msg'});
}
return undef;
}
@ -987,6 +993,12 @@ sub init {
# Disable verify host certificate (only needed for self-signed cert)
$conf->{'__system'}->{ua}->ssl_opts( 'verify_hostname' => 0 );
$conf->{'__system'}->{ua}->ssl_opts( 'SSL_verify_mode' => 0x00 );
# Disable library extra checks
BEGIN {
$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL";
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
}
}
}
};