If you are daft enough to have a directory (rather than a file) called key.pkcs12 it trips up the check. I don't know why it happened, I also haven't yet validated whether it would work correctly if the folder had a file with the same name inside it.
Throws a different error (admittedly not as clear as it could be potentially):
mkdir foodir
check_ssl_cert -f foodir
/bin/cat: foodir: Is a directory
unable to load CRL
140258245657024:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:../crypto/asn1/asn1_lib.c:101:
Invalid command ''; type "help" for a list.
Invalid command ''; type "help" for a list.
unable to load certificate
140473507004864:error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: TRUSTED CERTIFICATE
unable to load certificate
140517028315584:error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: TRUSTED CERTIFICATE
unable to load certificate
140508979888576:error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: TRUSTED CERTIFICATE
Invalid command ''; type "help" for a list.
Invalid command ''; type "help" for a list.
Invalid command ''; type "help" for a list.
Invalid command ''; type "help" for a list.
unable to load certificate
140260636840384:error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: TRUSTED CERTIFICATE
unable to load certificate
139930951221696:error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: TRUSTED CERTIFICATE
SSL_CERT CRITICAL foodir: SSL error: unable to load certificate
Expected behavior
Behave the same when passed an empty folder, regardless of the name of it...
System (please complete the following information):
OS: Ubuntu
OS version: 18.04
check_ssl_cert version: 2.22.0
OpenSSL version (openssl version): OpenSSL 1.1.1 11 Sep 2018
Describe the bug
If you are daft enough to have a directory (rather than a file) called key.pkcs12 it trips up the check. I don't know why it happened, I also haven't yet validated whether it would work correctly if the folder had a file with the same name inside it.
Sorry I've only tried it on 2.22.0 for now...
To Reproduce
Fails/throws a less clear error:
Throws a different error (admittedly not as clear as it could be potentially):
Expected behavior
Behave the same when passed an empty folder, regardless of the name of it...
System (please complete the following information):
openssl version
): OpenSSL 1.1.1 11 Sep 2018Additional context/output
N/A