Improved LWP ssl ignore certificate added extra debug

This commit is contained in:
fbsanchez 2018-09-03 11:26:01 +02:00
parent b52661054d
commit 8f4e8c3110
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;
}
}
}
};