Skip to content

Instantly share code, notes, and snippets.

@tst2005
Last active February 19, 2018 15:26
Show Gist options
  • Select an option

  • Save tst2005/797af97fd263677da9e3eede873887ac to your computer and use it in GitHub Desktop.

Select an option

Save tst2005/797af97fd263677da9e3eede873887ac to your computer and use it in GitHub Desktop.
openssl 1.1.x remove the /usr/lib/ssl/misc/c_info and change the issuer/subject text output format
#!/bin/sh
# source: https://gist.github.com/tst2005/797af97fd263677da9e3eede873887ac
for i in $*
do
echo "$i"
openssl x509 -subject -issuer -enddate -noout -in $i \
| sed -e 's#, \([^ ]\+\) = #/\1=#g' -e 's,^\(subject\|issuer\)=\([^ ]\+\) = ,\1= /\2=,g'
echo "--------"
done
@tst2005
Copy link
Copy Markdown
Author

tst2005 commented Feb 19, 2018

  • openssl <= 1.0.x
subject= /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
issuer= /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
notAfter=Aug 21 04:00:00 2018 GMT
  • openssl >= 1.1x
subject=C = US, O = GeoTrust Inc., CN = GeoTrust Global CA
issuer=C = US, O = Equifax, OU = Equifax Secure Certificate Authority
notAfter=Aug 21 04:00:00 2018 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment