Skip to content

Instantly share code, notes, and snippets.

@rglastra
Last active September 2, 2022 16:23
Show Gist options
  • Save rglastra/3ef9582c6292470a1743 to your computer and use it in GitHub Desktop.
Save rglastra/3ef9582c6292470a1743 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"
@wutzebaer
Copy link

suse 13.2:

awk -v cmd='openssl x509 -noout -subject' '/BEGIN/{close(cmd)};{print | cmd}' < /var/lib/ca-certificates/ca-bundle.pem | grep "G5"

@alexzeit
Copy link

hi there, ihave started the script and got this mesage, wha does i mean, do i have VeriSign G5-Root-Zertifikat on root?

subject= /CN=T\xC3\x9CRKTRUST Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xC4\xB1c\xC4\xB1s\xC4\xB1/C=TR/L=Ankara/O=T\xC3\x9CRKTRUST Bilgi \xC4\xB0leti\xC5\x9Fim ve Bili\xC5\x9Fim G\xC3\xBCvenli\xC4\x9Fi Hizmetleri A.\xC5\x9E. (c) Aral\xC4\xB1k 2007
subject= /C=GB/O=Trustis Limited/OU=Trustis FPS Root CA
subject= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
All certificates in ca-certificates.crt, listed by subject, check for presence of VeriSign's 'Class 3 Public Primary - G5':
subject= /C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5
root@vm:~# ^C

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