matteocorti/check_ssl_cert

SSL_CERT UNKNOWN: --temp can be specified only once

Closed this issue · 3 comments

Describe the bug

Using the command line option --temp leads to the error SSL_CERT UNKNOWN: --temp can be specified only once together with an exit status of 3.

To Reproduce

$ ./check_ssl_cert -H github.com -p 443 -w 20 -c 10 --temp /tmp/check_ssl_cert
SSL_CERT UNKNOWN: --temp can be specified only once

Expected behavior

$ ./check_ssl_cert -H github.com -p 443 -w 20 -c 10 --temp /tmp/check_ssl_cert
SSL_CERT OK - github.com:443, https, x509 certificate 'github.com' from 'Sectigo Limited' valid until Mar  7 23:59:59 2025 GMT (expires in 163 days)|days_chain_elem1=163;20;10;; days_chain_elem2=2288;20;10;; days_chain_elem3=1558;20;10;;

System (please complete the following information):

  • OS: Debian GNU/Linux
  • OS version: 12.7
  • check_ssl_cert version: 2.84.0 (most recent version from master branch)
  • OpenSSL version (openssl version): OpenSSL 3.0.14 4 Jun 2024 (Library: OpenSSL 3.0.14 4 Jun 2024)

Additional context/output

What happens is the following:

  • In lines 4246-4249 the variable TMPDIR is set to a default value.
  • In line 4265, parse_command_line_options is called.
  • In line 3964, the check whether TMPDIR is empty fails.

Thanks, I implemented the checks for multiple command line options last night, but I did not yet test everything.

Thanks for the fixing this so quickly!

The last bug fix should correct all the issues with the additional checks I released too early.