diff --git a/apps/protocols/http/mode/expectedcontent.pm b/apps/protocols/http/mode/expectedcontent.pm index cc1d0d02e..2ccbb6a6b 100644 --- a/apps/protocols/http/mode/expectedcontent.pm +++ b/apps/protocols/http/mode/expectedcontent.pm @@ -61,6 +61,7 @@ sub new { "proxyurl:s" => { name => 'proxyurl' }, "expected-string:s" => { name => 'expected_string' }, "timeout:s" => { name => 'timeout', default => '3' }, + "ssl:s" => { name => 'ssl', }, }); return $self; } @@ -158,6 +159,10 @@ Specify password for basic authentification (Mandatory if --credentials is speci Threshold for HTTP timeout +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + =item B<--expected-string> Specify String to check on the Webpage diff --git a/apps/protocols/http/mode/jsoncontent.pm b/apps/protocols/http/mode/jsoncontent.pm index 7bc61476a..6c2166ded 100644 --- a/apps/protocols/http/mode/jsoncontent.pm +++ b/apps/protocols/http/mode/jsoncontent.pm @@ -67,6 +67,7 @@ sub new { "expected-string:s" => { name => 'expected_string' }, "header:s@" => { name => 'header' }, "timeout:s" => { name => 'timeout', default => 10 }, + "ssl:s" => { name => 'ssl', }, "warning-numeric:s" => { name => 'warning_numeric' }, "critical-numeric:s" => { name => 'critical_numeric' }, @@ -419,6 +420,10 @@ Specify password for basic authentification (Mandatory if --credentials is speci Threshold for HTTP timeout (Default: 10) +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + =item B<--header> Set HTTP headers (Multiple option) diff --git a/apps/protocols/http/mode/responsetime.pm b/apps/protocols/http/mode/responsetime.pm index 1e99b50ab..8193506e7 100644 --- a/apps/protocols/http/mode/responsetime.pm +++ b/apps/protocols/http/mode/responsetime.pm @@ -63,6 +63,7 @@ sub new { "warning:s" => { name => 'warning' }, "critical:s" => { name => 'critical' }, "timeout:s" => { name => 'timeout', default => '3' }, + "ssl:s" => { name => 'ssl', }, }); return $self; } @@ -173,6 +174,10 @@ Proxy URL if any Threshold for HTTP timeout +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + =item B<--warning> Threshold warning in seconds (Webpage response time) diff --git a/apps/protocols/http/mode/soapcontent.pm b/apps/protocols/http/mode/soapcontent.pm index a5213d27c..d0a8342d9 100644 --- a/apps/protocols/http/mode/soapcontent.pm +++ b/apps/protocols/http/mode/soapcontent.pm @@ -67,6 +67,7 @@ sub new { "expected-string:s" => { name => 'expected_string' }, "header:s@" => { name => 'header' }, "timeout:s" => { name => 'timeout', default => 10 }, + "ssl:s" => { name => 'ssl', }, "warning-numeric:s" => { name => 'warning_numeric' }, "critical-numeric:s" => { name => 'critical_numeric' }, @@ -433,6 +434,10 @@ Specify password for basic authentification (Mandatory if --credentials is speci Threshold for HTTP timeout (Default: 10) +=item B<--ssl> + +Specify SSL version (example : 'sslv3', 'tlsv1'...) + =item B<--header> Set HTTP headers (Multiple option) diff --git a/centreon/plugins/httplib.pm b/centreon/plugins/httplib.pm index 5683339da..d93e2afdc 100644 --- a/centreon/plugins/httplib.pm +++ b/centreon/plugins/httplib.pm @@ -116,6 +116,14 @@ sub connect { if (defined($self->{option_results}->{proxyurl})) { $ua->proxy(['http', 'https'], $self->{option_results}->{proxyurl}); } + + if (defined($self->{option_results}->{ssl}) && $self->{option_results}->{ssl} ne '') { + use IO::Socket::SSL; + my $context = new IO::Socket::SSL::SSL_Context( + SSL_version => $self->{option_results}->{ssl}, + ); + IO::Socket::SSL::set_default_context($context); + } $response = $ua->request($req);