ssl-cert-check icon indicating copy to clipboard operation
ssl-cert-check copied to clipboard

Update extraction of certificate issuer

Open michaelzischka opened this issue 7 years ago • 2 comments

The issuer can be extracted from the temporary certificate file.

When using ssl-cert-check in Debian Stretch, the issuer will not be extracted, because the regular expression does not fit anymore when using openssl command. The format of the temporary certificate file is the same as in previous Debian releases, therefore the regular expression to extract the issuer still fits and grep does the job.

This is not tested against other Linux distributions.

michaelzischka avatar Dec 07 '17 10:12 michaelzischka

Hey Michael,

Could I get a copy of the temporary certificate that isn't matching the regex? Also, which version of openssl does stretch ship with? I've tested the script on Ubuntu, CentOS and Fedora and it works like a champ. Curious what is different with Debian.

Thanks,

  • Ryan

Matty9191 avatar Jan 25 '18 14:01 Matty9191

Hey Ryan,

the returned value of the openssl statement before my change would return the line:

issuer=C = US, O = "thawte, Inc.", CN = thawte SHA256 SSL CA

So you see, that the piped awk statement would fail to provide the correct issuer from the O field, because the record separator is not /. Therefore I extracted the issuer with a grep statement from the input file, because its format is the same for all my tested Debian versions.

In Debian 9.0 the used OpenSSL version is 1.1.0f, but I don't know, if that's the problem.

Maybe there is another workaround.

Unfortunately I don't have other Linux distributions around, so I don't know, if my change breaks on them.

Regards, Michael

michaelzischka avatar Jan 26 '18 11:01 michaelzischka