Skip to content

Commit

Permalink
--ignore-connection-state cannot be used if nmap is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
matteocorti committed Nov 22, 2023
1 parent 4f62590 commit 4ad4cb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions check_ssl_cert
Original file line number Diff line number Diff line change
Expand Up @@ -5091,6 +5091,11 @@ main() {
verboselog "cannot find nmap: disabling connection checks and ciphers checks"
debuglog "cannot find nmap: disabling connection checks and ciphers checks"
DISABLE_NMAP=1

if [ -n "${IGNORE_CONNECTION_STATE}" ] ; then
unknown "--ignore-connection-state requires nmap"
fi

else
if [ ! -x "${NMAP_BIN}" ]; then
unknown "${NMAP_BIN} is not executable"
Expand Down
8 changes: 3 additions & 5 deletions test/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ fi

create_temporary_test_file() {

SUFFIX=$1

if mktemp --help 2>&1 | grep -q 'TEMPLATE must end with XXXXXX'; then
# no suffix possible
SUFFIX=
fi

# create a temporary file
TEMPFILE="$(mktemp "${TMPDIR}/XXXXXX${SUFFIX}" 2>/dev/null)"
TEMPFILE="$(mktemp "${TMPDIR}/XXXXXX" 2>/dev/null)"

if [ -z "${TEMPFILE}" ] || [ ! -w "${TEMPFILE}" ]; then
fail 'temporary file creation failure.'
Expand Down Expand Up @@ -1300,11 +1298,11 @@ testGithubComCRL() {

GITHUB_CRL_URI=$(${OPENSSL} x509 -in "${TEMPFILE_GITHUB_CERT}" -noout -text | grep -A 6 "X509v3 CRL Distribution Points" | grep "http://" | head -1 | sed -e "s/.*URI://")

create_temporary_test_file '.crl'
create_temporary_test_file
TEMPFILE_CRL=${TEMPFILE}

echo "${GITHUB_CRL_URI}"
curl --silent --output "${TEMPFILE_CRL}" "${GITHUB_CRL_URI}"
curl --silent "${GITHUB_CRL_URI}" --output "${TEMPFILE_CRL}"

# shellcheck disable=SC2086
${SCRIPT} ${TEST_DEBUG} --file "${TEMPFILE_CRL}" --ignore-exp --ignore-maximum-validity
Expand Down

0 comments on commit 4ad4cb4

Please sign in to comment.