Check_webinject plugin will not connect to https site using

nagiosperl

We're using Nagios to monitor some of our web sites. We have a script that uses the older plugin that we are trying to switch to using webinject.pl from cpan. When the script runs, it generates this error:

LWP::Protocol::https::Socket: SSL connect attempt failed with unknown error error:1407741A:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert decode error at /usr/local/share/perl5/LWP/Protocol/http.pm line 51.

It appears the web site does not support TLSv1 for https. If it matters, the site is a Cisco WebVPN. I've pointed the same script at a different site that does support TLSv1 and it seems to work fine.

My web search is coming up empty.
Successful connect:

<case
id="1"
description1="Metro Home Page"
description2="Metro, login test"
method="get"
url="https://metro.myco.com/index.php"
verifypositive="restricted"
logrequest="yes"
logresponse="yes"
sleep="1"

/>

Failing connect:

<case
id="2"
description1="WebVPN Home Page"
description2="webvpn.myco.com login test"
method="get"
url="https://webvpn.myco.com/webvpn.html"
verifypositive="Authorized"
logrequest="yes"
logresponse="yes"
sleep="1"

/>

Best Answer

I've done some more work on this and have a partial fix that I don't like. I added a line to the code into sub _get_useragent

 $useragent->ssl_opts( SSL_version => 'SSLv3' );

that forces SSLv3. This will allow the plugin to connect to THIS site. I'll likely copy the plugin so it is specific to this site. But a better solution would be to add an option to the test case.