From f29f7fc23976e41878663dcbf35194a06ec365d4 Mon Sep 17 00:00:00 2001 From: Nacho Rivera <59198746+n4ch04@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:39:17 +0200 Subject: [PATCH] fix(extra7183): Exception handling error UnsupportedOperationException (#1410) --- checks/check_extra7183 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/checks/check_extra7183 b/checks/check_extra7183 index 834bac346a..4c2008b51e 100644 --- a/checks/check_extra7183 +++ b/checks/check_extra7183 @@ -41,10 +41,14 @@ extra7183(){ textInfo "${regx}: Access Denied trying to list certificates" "${regx}" continue fi + if grep -q -E 'UnsupportedOperationException' <<< "${CERT_DATA}"; then + textInfo "${regx}: Error calling the ListCertificates operation: LDAPS operations are not supported for this Directory Type (directory id: ${DIRECTORY_ID})" "${regx}" + continue + fi if [[ ${CERT_DATA} ]]; then echo "${CERT_DATA}" | while read -r CERTIFICATE_ID NOTAFTER; do EXPIRES_DATE=$(timestamp_to_date "${NOTAFTER}") - if [[ ${EXPIRES_DATE} == "" ]] + if [[ ${EXPIRES_DATE} == "" ]] then textInfo "${regx}: LDAP Certificate ${CERTIFICATE_ID} has an incorrect timestamp format: ${NOTAFTER}" "${regx}" "${CERTIFICATE_ID}" else @@ -57,7 +61,7 @@ extra7183(){ fi done else - textFail "${regx}: Directory Service ${DIRECTORY_ID} does not have a LDAP Certificate configured" "${regx}" "${DIRECTORY_ID}" + textFail "${regx}: Directory Service ${DIRECTORY_ID} does not have a LDAP Certificate configured" "${regx}" "${DIRECTORY_ID}" fi done else