Check_http cannot make SSL connection

The check_http plugin seems not to be able to connect to an https (let’s encrypt) website. These are some outputs

# /usr/lib64/nagios/plugins/check_http --version
check_http v2.2.1 (nagios-plugins 2.2.1)
# /usr/lib64/nagios/plugins/check_http -H HOSTNAME -v -S
CRITICAL - Cannot make SSL connection.
SSL initialized
# curl -I https://HOSTNAME
HTTP/1.1 302 Found
Cache-Control: private
Content-Length: 131
Content-Type: text/html; charset=utf-8
Location: /Account/Logon
Server: Microsoft-IIS/8.5
X-AspNetMvc-Version: 4.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
x-frame-options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000
Date: Fri, 09 Feb 2018 16:12:22 GMT

What could be the reason?

Hi,

try to adding the --sni attribute to your check_http call.

This will enable the hostname extension support for TLS/SSL.

Documentation can be found here: http://nagios-plugins.org/doc/man/check_http.html

Best regards
Michael

2 Likes

Thanks, that did it. Must have looked over that option :stuck_out_tongue: