Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ericmdev/d7ac915e79d91e58ae6cacc249ec9b02 to your computer and use it in GitHub Desktop.
Save ericmdev/d7ac915e79d91e58ae6cacc249ec9b02 to your computer and use it in GitHub Desktop.
Check available certs in ca-certificates.crt by subject.
#!/bin/bash
echo "All certificates in ca-certificates.crt, listed by subject:"
awk -v cmd='openssl x509 -noout -subject' '/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt
echo "All certificates in ca-certificates.crt, listed by subject, check for presence of VeriSign's 'Class 3 Public Primary - G5':"
awk -v cmd='openssl x509 -noout -subject' '/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt | grep "G5"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment