Home > Back-end >  How to print out the common name of all certificates in current folder?
How to print out the common name of all certificates in current folder?

Time:08-16

I would like to filter out all common names of certificates in the current folder to troubleshoot which certificates are trusted.

CodePudding user response:

Common name can be filtered using the following command:

$ openssl x509 -noout -subject -in /etc/ssl/glusterfs.pem

Looping over files in the current folder can be achieved with:

$ for f in *; do echo "Processing $f file..."; done

To display common names for all certificates in current folder:

$ for f in *; do openssl x509 -noout -subject -in $f; done
  • Related