diff --git a/lib/emailreports.pm b/lib/emailreports.pm index 27389c4..45e7826 100644 --- a/lib/emailreports.pm +++ b/lib/emailreports.pm @@ -37,6 +37,8 @@ sub emailreports_send { my $base_cgi = $config->{base_cgi}; my $imgs_dir = $config->{imgs_dir}; my $images; + + my $self_signed_certs = $config->{use_self_signed_certificates}; logger("$myself: sending $report reports."); @@ -84,6 +86,9 @@ EOF # generate the graphs and get the html source my $url = $emailreports->{url_prefix} . $base_cgi . "/monitorix.cgi?mode=localhost&graph=_$g&when=$when&color=white"; my $ua = LWP::UserAgent->new(timeout => 30); + if ($self_signed_certs == 1) { + $ua->ssl_opts(verify_hostname => 0); + } my $response = $ua->request(HTTP::Request->new('GET', $url)); my $data = $response->content;