Skip to content

Commit

Permalink
Fixes #451
Browse files Browse the repository at this point in the history
  • Loading branch information
matteocorti committed Apr 7, 2023
1 parent 64abe42 commit e22b2b8
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ authors:
given-names: "Дилян"
website: https://github.com/dilyanpalauzov
title: "check_ssl_cert"
version: 2.63.0
date-released: 2023-04-05
version: 2.64.0
date-released: 2023-04-07
url: "https://github.com/matteocorti/check_ssl_cert"
repository-code: "https://github.com/matteocorti/check_ssl_cert"
keywords:
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-04-07 Matteo Corti <[email protected]>

* check_ssl_cert (main): Fixed the resolution of hosts with IPv6 addresses only

2023-04-05 Matteo Corti <[email protected]>

* check_ssl_cert (main): Better (earlier) check for non-existing hosts
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# News

* 2023-04-07 Version 2.64.0
* Fixed the resolution of hosts with IPv6 addresses only
* 2023-04-05 Version 2.63.0
* Command line option to ignore SSL Labs errors (```-ignore-ssl-labs-errors```)
* Better checks for non-resolvable hosts
Expand Down
3 changes: 1 addition & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* Command line option to ignore SSL Labs errors (```-ignore-ssl-labs-errors```)
* Better checks for non-resolvable hosts
Fixed the resolution of hosts with IPv6 addresses only
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.63.0
2.64.0
4 changes: 2 additions & 2 deletions check_ssl_cert
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
################################################################################
# Constants

VERSION=2.63.0
VERSION=2.64.0
SHORTNAME="SSL_CERT"

VALID_ATTRIBUTES=",startdate,enddate,subject,issuer,modulus,serial,hash,email,ocsp_uri,fingerprint,"
Expand Down Expand Up @@ -4212,7 +4212,7 @@ main() {
critical "${SHORTNAME} CRITICAL: Cannot resolve ${HOST} (no AAAA record)"
fi
else
if ! host "${HOST}" | grep -q 'has address' ; then
if ! host "${HOST}" | grep -q 'has .*address' ; then
critical "${SHORTNAME} CRITICAL: Cannot resolve ${HOST}"
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion check_ssl_cert.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" Process this file with
.\" groff -man -Tascii check_ssl_cert.1
.\"
.TH "check_ssl_cert" 1 "April, 2023" "2.63.0" "USER COMMANDS"
.TH "check_ssl_cert" 1 "April, 2023" "2.64.0" "USER COMMANDS"
.SH NAME
check_ssl_cert \- checks the validity of X.509 certificates
.SH SYNOPSIS
Expand Down
5 changes: 4 additions & 1 deletion check_ssl_cert.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%global version 2.63.0
%global version 2.64.0
%global release 0
%global sourcename check_ssl_cert
%global packagename nagios-plugins-check_ssl_cert
Expand Down Expand Up @@ -54,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT
%endif

%changelog
* Fri Apr 7 2023 Matteo Corti <[email protected]> - 2.64.0-0
- Updated to 2.64.0

* Wed Apr 5 2023 Matteo Corti <[email protected]> - 2.63.0-0
- Updated to 2.63.0

Expand Down
36 changes: 36 additions & 0 deletions test/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,42 @@ testIPv6() {
fi
}

testIPv6Only() {
if "${OPENSSL}" s_client -help 2>&1 | grep -q -- -6; then

IPV6=
if command -v ifconfig >/dev/null && ifconfig -a | grep -q -F inet6; then
IPV6=1
elif command -v ip >/dev/null && ip addr | grep -q -F inet6; then
IPV6=1
fi

if [ -n "${IPV6}" ]; then

echo "IPv6 is configured"

if ping6 -c 3 ipv6.corti.li >/dev/null 2>&1; then

echo "IPv6 is working"

# shellcheck disable=SC2086
${SCRIPT} ${TEST_DEBUG} --rootcert-file cabundle.crt -H ipv6.corti.li --ignore-host-cn --ignore-exp
EXIT_CODE=$?
assertEquals "wrong exit code" "${NAGIOS_OK}" "${EXIT_CODE}"

else
echo "IPv6 is configured but not working: skipping test"
fi

else
echo "Skipping forcing IPv6: not IPv6 configured locally"
fi

else
echo "Skipping forcing IPv6: no OpenSSL support"
fi
}

testIPv6Numeric() {
if "${OPENSSL}" s_client -help 2>&1 | grep -q -- -6; then

Expand Down

0 comments on commit e22b2b8

Please sign in to comment.