Skip to content

Commit

Permalink
Fixes #448
Browse files Browse the repository at this point in the history
  • Loading branch information
matteocorti committed Mar 16, 2023
1 parent be99cd0 commit da339fc
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 7 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.61.0
date-released: 2023-03-09
version: 2.62.0
date-released: 2023-03-16
url: "https://github.com/matteocorti/check_ssl_cert"
repository-code: "https://github.com/matteocorti/check_ssl_cert"
keywords:
Expand Down
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2023-03-16 Matteo Corti <[email protected]>

* check_ssl_cert: unset TIMEOUT_REASON after the the context it should be used
* check_ssl_cert: added some more TIMEOUT_REASON messages

2023-03-09 Matteo Corti <[email protected]>

* check_ssl_cert (main): Fixed the RSA algorithms
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# News

* 2023-03-16 Version 2.62.0
* Fixed the output in case of timeout
* Fixed the ciphers with ```--rsa```
* 2023-03-09 Version 2.61.0
* Fixed the algorithms used by ```--rsa```
* 2023-02-15 Version 2.60.0
Expand Down
3 changes: 2 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Fixed the algorithms used by ```--rsa```
Fixed the output in case of timeout
Fixed the ciphers with ```--rsa```
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.61.0
2.62.0
17 changes: 16 additions & 1 deletion check_ssl_cert
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
################################################################################
# Constants

VERSION=2.61.0
VERSION=2.62.0
SHORTNAME="SSL_CERT"

VALID_ATTRIBUTES=",startdate,enddate,subject,issuer,modulus,serial,hash,email,ocsp_uri,fingerprint,"
Expand Down Expand Up @@ -106,6 +106,8 @@ fetch_http_headers() {

if [ -z "${CACHED_HEADERS}" ]; then

TIMEOUT_REASON='Fetching HTTP headers'

debuglog "Fetching headers"

create_temporary_file
Expand Down Expand Up @@ -141,6 +143,8 @@ fetch_http_headers() {
cp "${CACHED_HEADERS}" headers.txt
fi

unset TIMEOUT_REASON

fi

}
Expand Down Expand Up @@ -1819,6 +1823,7 @@ check_crl() {
else
exec_with_timeout "${CURL_BIN} ${CURL_PROXY} ${CURL_PROXY_ARGUMENT} ${INETPROTO} --silent --location \\\"${CRL_URI}\\\" > ${CRL_TMP_DER}"
fi
unset TIMEOUT_REASON

# convert DER to
debuglog "Converting ${CRL_TMP_DER} (DER) to ${CRL_TMP_PEM} (PEM)"
Expand Down Expand Up @@ -1937,6 +1942,7 @@ check_ocsp() {
else
exec_with_timeout "${CURL_BIN} ${CURL_PROXY} ${CURL_PROXY_ARGUMENT} ${INETPROTO} --silent --location \\\"${ELEMENT_ISSUER_URI}\\\" > ${ISSUER_CERT_TMP}"
fi
unset TIMEOUT_REASON

TYPE_TMP="$(${FILE_BIN} -L -b "${ISSUER_CERT_TMP}" | sed 's/.*://')"
debuglog "OCSP: issuer certificate type (1): ${TYPE_TMP}"
Expand Down Expand Up @@ -2615,6 +2621,8 @@ fetch_certificate() {

fi

unset TIMEOUT_REASON

debuglog "storing the certificate to ${CERT}"
TYPE_TMP="$(${FILE_BIN} -L -b "${CERT}" | sed 's/.*://')"
debuglog "certificate type (2): ${TYPE_TMP}"
Expand Down Expand Up @@ -4479,6 +4487,7 @@ main() {
else
exec_with_timeout "${CURL_BIN} ${CURL_PROXY} ${CURL_PROXY_ARGUMENT} ${INETPROTO} --silent --location \\\"${FILE_URI}\\\" > ${FILE}"
fi
unset TIMEOUT_REASON

if [ ! -r "${FILE}" ]; then
critical "Cannot fetch ${FILE_URI}"
Expand Down Expand Up @@ -5425,6 +5434,7 @@ main() {
RET=$?
;;
esac
unset TIMEOUT_REASON
if [ "${RET}" -eq 1 ]; then
Expand Down Expand Up @@ -6174,6 +6184,7 @@ INPUT
# -Pn is needed even if we specify a port
TIMEOUT_REASON="checking ciphers"
exec_with_timeout "${NMAP_BIN} --unprivileged -Pn --script +ssl-enum-ciphers ${NMAP_INETPROTO} ${HOST_ADDR} -p ${PORT}" "${NMAP_OUT}" "${NMAP_ERR}"
unset TIMEOUT_REASON
if [ "${DEBUG}" -ge 1 ]; then
debuglog 'nmap output:'
Expand Down Expand Up @@ -6266,6 +6277,8 @@ ${WARNING}"
# Check SSL Labs
if [ -n "${SSL_LAB_CRIT_ASSESSMENT}" ]; then
TIMEOUT_REASON='SSL Lab assesstment'
create_temporary_file
JSON=${TEMPFILE}
debuglog "Storing the SSL Labs JSON output to ${JSON}"
Expand Down Expand Up @@ -6388,6 +6401,8 @@ ${WARNING}"
done
unset TIMEOUT_REASON
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 "March, 2023" "2.61.0" "USER COMMANDS"
.TH "check_ssl_cert" 1 "March, 2023" "2.62.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.61.0
%global version 2.62.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
* Thu Mar 16 2023 Matteo Corti <[email protected]> - 2.62.0-0
- Updated to 2.62.0

* Thu Mar 9 2023 Matteo Corti <[email protected]> - 2.61.0-0
- Updated to 2.61.0

Expand Down

0 comments on commit da339fc

Please sign in to comment.